File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes OO, Patterns, UML and Refactoring and the fly likes Best practice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Best practice" Watch "Best practice" New topic

Best practice

Anand Gondhiya
Ranch Hand

Joined: Feb 24, 2004
Posts: 155
Hi All,

I use struts 1.1 , Weblogic on Win2000.

I have a dropdown menu on my JSP page. data in this dropdown menu is supposed to come from Database.

I am familiar with design patterns like DAO,VO(DTO),Singleton etc..

Could anybody tell me what's the best practice to populate this dropdown menu from the data which came from Database.

Anand Gondhiya
Ranch Hand

Joined: Feb 24, 2004
Posts: 155
How about putting the DAOs inside the ActionServlet and thus getting dropdown data in ActionServlet only. Once we have data(Collection) , we can put that in to the scope (request or session) and then use it in View ( JSP)
is this a good solution ?
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
LOL. I think it is not a good solution... it's the only good solution.


blog -
I agree. Here's the link:
subject: Best practice
jQuery in Action, 3rd edition