I'm new-ish to struts and I'm particularly stuck on an area of struts code which has to do with the radio button. No matter what I do I can't get anything but a false value from the following: (CostForm)
<td align="left" width="200px" colspan="2">
<html:radio property="responsableBool" value="false"/>No
<html:radio property="responsableBool" value="true"/>Yes
</td>
It is then initialised from this piece of code:
CostForm costform = (CostForm) form;
Cost cost = new Cost();
costform.populateModel(cost);
and the populateModel just has: PropertyUtils.copyProperties(cost,this);
The only thing I can think of is that struts doesn't allow the radio buttons to reference the same property with different values.
Given the form:
The HTML:
The action:
When I click "No" and "Yes" I get the expected boolean value inside the action.
I'd double-check things like spelling (the English spelling would be "responsible"; perhaps it's spelled correctly in
Cost
?), action/form mismatches (are you using the right form "name" in the action mapping?), and so on.