aspose file tools
The moose likes JSP and the fly likes how to populate drop down list using servlet and jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "how to populate drop down list using servlet and jsp" Watch "how to populate drop down list using servlet and jsp" New topic
Author

how to populate drop down list using servlet and jsp

swaminathan kethar
Greenhorn

Joined: Mar 28, 2012
Posts: 1
I have one database. I need to populate dropdown list dynamically. that is, i need to populate empid in jsp from the database.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56229
    
  13

In the servlet page controller for the JSP, delegate to the Model to fetch the information for the drop down. Place the information into request scope as a List or Map. In the JSP, use the JSTL and EL to create the drop down options.

Your turn.

Write some code and let us know where you have difficulties.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

One more thing: figure out what the HTML for this drop-down list should look like. It might help to write it down on a piece of paper, or something like that. Then make sure you write your JSP so that it generates that HTML.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to populate drop down list using servlet and jsp
 
Similar Threads
How to dynamically populate
Populating List box in the JSP from Action Class
Ajax: how to achieve
Display a list based on JSP input
JSP/Javascript DropDown List problem