File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes select tag in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "select tag in jsp" Watch "select tag in jsp" New topic

select tag in jsp

ashish sood

Joined: Oct 03, 2009
Posts: 8
I am trying to populate my select tag with values from the database but problem is that i am getting different drop down menus for each value of database.

<form action="checkt1.jsp" method="post">
<select name="val1"><option value="not specified">S E L E C T</option>
while (
out.println("<option value='"+val+"'>"+val+"</option>");

please help..
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63866

Have you looked at the HTML being sent to the browser? Is it correct?

And why are you still using Java scriptlets in a JP?

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: select tag in jsp
It's not a secret anymore!