wood burning stoves 2.0*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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

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
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:


Consultant, Sima Solutions
Christian Nash
Ranch Hand

Joined: Jan 17, 2006
Posts: 107

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
I agree. Here's the link: http://aspose.com/file-tools
subject: how to get selected check box values in struts?
Similar Threads
display in Jsp
check boxes
Getting the Form elements
checkbox in jsp
CheckBoxes and RadioButtons