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 Simple JSTL and Struts Question 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 "Simple JSTL and Struts Question" Watch "Simple JSTL and Struts Question" New topic
Author

Simple JSTL and Struts Question

Garandi Garandi
Ranch Hand

Joined: Jan 07, 2003
Posts: 192
Hi,
I have the following line in my jsp page.


which renders n checkboxes,more over I use DynaActionForm.
Question: How do I know which checkbox was clicked and which one wasn't using DynaActionForm?
Thank you in advance
Garandi
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Moved to the Struts forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
In your action form, the property "test" should be defined as type String[]. When the form is submitted, this String array will contain a string matching the value attribute for each check box that was checked.

If you want the check boxes to be checked or unchecked based on the current value of the "test" array in the DynaActionForm, you should use the struts <html:checkboxes> tag.


Merrill
Consultant, Sima Solutions
Garandi Garandi
Ranch Hand

Joined: Jan 07, 2003
Posts: 192
Hi Merrill,
Thank you very much for your reply, it was very useful. I change to


I see the lable for the checkboxes but not the checkbox itself, I try to use multibox I had the same problem. although I have the following line on top of my page <%@ taglib uri="/tags/struts-html-el" prefix="html" %>
In the log I get the following error
Could not complete parsing, unmatched tags: submit

Thank you
Garandi
[ May 05, 2005: Message edited by: Garandi Garandi ]
Garandi Garandi
Ranch Hand

Joined: Jan 07, 2003
Posts: 192
I had a <br /> and that was causing problem, now it works.
Thank you
Garandi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple JSTL and Struts Question
 
Similar Threads
Validation
ActionForm, ArrayList of VLOs , and populating them in the JSP
display array from servlet
Dynamic population of second list box based on selection of first
Default JSTL URI can't be resolved