2010-03-17 109 views
0

我尝试执行给定的servlet代码,就像例子来理解它是如何工作的。 但我不明白attribut optionDAO的用途以及使用它的必要性。 查找方法看起来像hibernate在包“.base”中给出的。 我该怎么做才能跳过这个。 谢谢。下拉列表; servlet问题

+1

你需要在这里提供一些细节。我们没有上下文来理解你在问什么? – 2010-03-17 12:26:48

+0

我敢打赌,他在谈论我的答案在这里:http://stackoverflow.com/questions/2263996/populating-child-dropdownlists-in-jsp-servlet在未来,你应该真的更清楚,user294750。 – BalusC 2010-03-17 13:47:32

回答

0

这只是一个虚构的代码示例,根据DAO模式,您需要自己编写/实现自我解释的类名和方法名。例如。

public class OptionDAO { 
    public List<Option> find(String dd, String val) { 
     // Write code here yourself which does the desired task: returning 
     // a list of options based on the given dropdown id and value. 
     return options; 
    } 
} 

怎么做的方法每环境是不同的,即,使用ORM库,数据模型的设计,等等。这是不可能给出一个具体的代码示例。示例如何使用“普通香草”JDBC执行此操作可以找到here。例子如何用Hibernate做到这一点可以找到here。考试如何用JPA做到这一点可以找到here