• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to get selected check box values in struts?

 
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
you need to get values of selected checkboxes and send it in request.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic