Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getting data from html drop down list to jsp

 
Meenal Srivastva
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my html code:
<select size="1" name="qualification">
<option value="M.Tech">M.Tech</option>
<option value="M.C.A.">M.C.A.</option>
<option value="B.Tech" selected>B.Tech</option>
</select>

And this is my jsp code:
<%= request.getParameter("qualification")%>

In the jsp, "null" is being displayed ...
But all the text type fields of the html are properly retrieved ....

Any suggestions...?

P.S. i have tried using tags(along with a bean) to do this too.....nothing works
 
santosh kothapalli
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
submit the html page and give the action attribute as jsp page then you will get the value.Before the page is submitted you cant retrieve the value using request.getParameter()
[ January 18, 2008: Message edited by: santosh kothapalli ]
 
Meenal Srivastva
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The html code is in a Html page (with a form whose action attribute is set to a different jsp page)...and the jsp page is different....

i guess i didnt specify my problem carefully!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Double check your HTML to make sure that the select list properly nested inside your form.

Look for nested forms.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic