struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Aggarwal" <>
Subject RE: checkbox : unchecked elements not in list
Date Fri, 04 Dec 2009 18:55:23 GMT
> Ideally I would want the accountStatus list to contains a 
> list of "true" or
> "false" strings, however accountStatus list only seems to 
> contains only the
> checked
> elements...

It looks like you are processing the submitted params
yourself.  If that is the case, the browser only gives 
you values for the checked boxes.  That is an http limitation, 
not struts.  If you want to do it that way, you will have
to check for the non-presence of unchecked boxes.

Struts will handle the checkboxes correctly if you let it handle 
the form submission.  On my form bean, I have boolean values 
for each of the checkboxes and set the checkbox to use
the field name: <s:checkbox name="myName"> 
When the user submits the form, everything
works as expected.  

Can you do that in your app instead of processing the 
request params yourself?


Neil Aggarwal, (281)846-8957,
Host your struts app on a CentOS VPS for only $25/month!
Unmetered bandwidth = no overage charges, 7 day free trial

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message