This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JSP and the fly likes Using Combo Boxes in JSP & Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Using Combo Boxes in JSP & Servlet" Watch "Using Combo Boxes in JSP & Servlet" New topic

Using Combo Boxes in JSP & Servlet

roopa chakra

Joined: Jul 12, 2005
Posts: 13

I need to display database table column values on JSP page whenever a user selects particular column name from Combo Box.I have dynamically populated column names in the Combo box. Below is the code.

ResultSetMetaData rsmd = rs.getMetaData();

for(int i=1;i<=rsmd.getColumnCount();i++)

Now the problem is I am not getting how to display particular column values
based on the selected combobox value.

Could anybody give me an approach.

roopa chakra
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

Just as in hand-written HTML, use the selected attribute on the appropriate option element.

Oh, and an HTML select element isn't a "Combo Box" so it's confusing to refer to it as so.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Using Combo Boxes in JSP & Servlet
It's not a secret anymore!