File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes how to get selected check box values in struts? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to get selected check box values in struts?" Watch "how to get selected check box values in struts?" New topic
Author

how to get selected check box values in struts?

Edward Durai
Ranch Hand

Joined: Oct 09, 2004
Posts: 223
Hi experts,

I have a one.jsp file. It contains multiple data with check boxes. How can I pass the selected check boxes to another action servelet and get the selected check box values?

Thank You
Edward Durai.A


Thank You<br />Edward
Surya Kant
Ranch Hand

Joined: Mar 29, 2005
Posts: 104
Hi,
you need to get values of selected checkboxes and send it in request.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Checkboxes are like any other form input. When submitted, Struts places the values in the ActionForm bean, which you can then access in the Action class specified by the action attribute of the <html:form> tag.

For checkboxes, you have your choice of using either the <html:checkboxes> or <html:multibox> tags.

Here is a link explaining how to use these tags:

http://struts.apache.org/struts-doc-1.2.x/api/org/apache/struts/taglib/html/package-summary.html#package_description


Merrill
Consultant, Sima Solutions
Christian Nash
Ranch Hand

Joined: Jan 17, 2006
Posts: 107
Hi,

The values which are to be sent to the action servlet need to be the values of the checkboxes. Then Action form takes these values by reflection and this Action form can be accessed in the Action class.


- Christian
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to get selected check box values in struts?
 
Similar Threads
display in Jsp
checkbox in jsp
CheckBoxes and RadioButtons
Getting the Form elements
check boxes