• Post Reply Bookmark Topic Watch Topic
  • New Topic

populate the combo box when the jsp page is first loaded

 
X Luo
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got a combo box in the jsp page, the data of which is from database, how can I do to make sure that the combo box is populated once the jsp page is loaded. What method I use for the form?
Thanks.
 
Vadiraj Deshpande
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I feel there are 3 ways of doing it.
1. Have a Javabean filled with data and use the <jsp:useBean> tag to fill the values.
2. Use a JSP custom tag which outputs the HTML of SELECT control(combo box) with data filled in.
3. Use scriptlets to fill data.
Surely as many agree I would go for option 1 or 2.
Hope this helps,
Have fun,,
Vadiraj.
 
X Luo
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Vadiraj.
Sorry for coming back to you so late. Have been very busy jsp-ing and forgot to check this out. Yes, I did sort the combo out finally.
Thanks again.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!