wood burning stoves 2.0*
The moose likes JSP and the fly likes JSP form processing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "JSP form processing" Watch "JSP form processing" New topic
Author

JSP form processing

Irus Albert
Greenhorn

Joined: Sep 14, 2010
Posts: 7
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

Joined: Oct 14, 2008
Posts: 1337

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

Joined: Sep 14, 2010
Posts: 7
Hi,

Actually I am printing request.getParameter("choice") and it is giving null. I tried
Pradeep Prabhakaran
Greenhorn

Joined: Sep 25, 2010
Posts: 7
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

Joined: Sep 24, 2010
Posts: 24
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
 
wood burning stoves
 
subject: JSP form processing