posted 19 years ago
Let's say you have a series of three radio buttons, all mapped to the "color" property, with one returning a value of "red", another "blue", and another "greeen". If none of the buttons is checked, no color parameter will be submitted to the server at all.
When Struts populates the form bean, the setter for color does not get called, so the property is null. I'm not sure why Struts doesn't consider a value of null to be in violation of the "required" condition. It appears to be looking for the value "". Therefore, in your reset() method, you should set the value of color to "".
The above occurs if the form is in request scope. If it's in session scope, it retains the value it had before, and is not changed. In this case it's even more critical that you reset the value of color in the reset() method.
That's why for check boxes and radio buttons, the manual recommends that you always set an unchecked value for the corresponding properties in the reset() method of the form.