• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get selected check box values in struts?

 
Edward Durai
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Surya Kant
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
you need to get values of selected checkboxes and send it in request.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Christian Nash
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic