By default, when an HTML form containing a checkbox is submitted, if the checkbox is checked the value that gets sent is the string "on", and if it's not checked there is no field for that checkbox at all in the form data. So you test for the presence of a value, or the absense of one.
You can change what value gets sent when the checkbox is checked by using the value
attribute (which works both on a standard HTML tag and on a Struts html:checkbox
tag, according to the Struts docs). You can't, with standard HTML, specify that a value should be sent if the checkbox is not checked.
I'm a bit confused at your saying you're getting "o" back. The Struts docs say the corresponding property will be a boolean
, not a String
.