File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How can I dynamically read from radio button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How can I dynamically read from radio button" Watch "How can I dynamically read from radio button" New topic
Author

How can I dynamically read from radio button

Muyiwa Phillips
Greenhorn

Joined: Mar 08, 2010
Posts: 1
I am developing a survey tool that pulls the questions and Answer options from the database in pure jsp no framework. As the question and answer options is been pulled from DB it dynamically generate radio button that is unique to the question and Answer options.

I will like to know how I can read through the questions and radio button selected and insert the selected answers option into the database.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60765
    
  65

While a JSP can be used to present the questions, the form should be submitted to a servlet not a JSP. JSPs are to present views, not perform data handling and processing.

As such I've moved this to the Servlets forum for any further discussion.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60765
    
  65

In the servlet, the request.getParameter() method can be used to retrieve the information submitted by the HTML form.

There are a few variations, such as request.getParameterMap(), which will retrieve all the submitted values as a Map implementation.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I dynamically read from radio button
 
Similar Threads
Radio button value with submit
Multiple choice SCJP exam?
Render form components with Ajax
Dynamic data population from database and display in jsp
JRadioButton