• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP form processing

 
Irus Albert
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a jsp where I have written an HTML form. The name of the jsp file is "this.jsp". The code is :


I am submitting to this jsp itself. How can I access the value of the checked radio button?

I tried something like



But, that is giving null value.
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This code doesn't do much of anything (it doesn't even compile, but I assume that's a copy/paste mistake). Try this instead:

 
Irus Albert
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Actually I am printing request.getParameter("choice") and it is giving null. I tried
 
Pradeep Prabhakaran
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont think you need to mention the name of the jsp page (if , you are submitting to the same page).
try this:


when you don't mention anything in the action, the form gets submitted to the same page.
 
Han Jie
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Irus Albert wrote:



you should invoke a method on request here, so you miss "()" behind keywords "getMethod"
it is a method not a field, reference to HttpServletRequest
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic