Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Design for the Mind this week in the Design 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