开发者

dropdown list;servlet Problem

I try to excute the servlet code given, like an exemple to understand how it works. BUT I did not understand from where the attribut optionDAO and what is the necessity to use it. The find method seems like the given by hibernate in package".base". What should I really do to ski开发者_如何学Cp this. Thanks.


It's just a fictive code example according the DAO pattern with a self-explaining classname and methodname which you need to write/implement yourself. E.g.

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;
    }
}

The way how to do it namely differs per environment, ORM libraries used, datamodel design, etc.. that it's impossible to give a concrete code example. Examples how to do it with "plain vanilla" JDBC can be found here. Examples how to do it with Hibernate can be found here. Examlpes how to do it with JPA can be found here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜