I've been reading through the struts-example-application. It works perfect. The checkbox is allways set correct, even if the Form-Bean would say not checked by default. Sorry I know, that sometimes I ask stuped questions but:
Who tells the Checkbox if it should be checked or not?
Subscription.jsp
----------------
<tr>
<th align="right">
<bean:message key="prompt.autoConnect"/>
</th>
<td align="left">
<html:checkbox property="autoConnect"/>
</td>
</tr>
I thougt it would be the Form-Bean that would have some logic implemented. But i cant find nothing.
SubscriptionForm
----------------
/**
* Should we auto-connect at startup time?
*/
private boolean autoConnect = false;
/**
* Return the auto-connect flag.
*/
public boolean getAutoConnect() {
return (this.autoConnect);
}
/**
* Set the auto-connect flag.
*
* @param autoConnect The new auto-connect flag
*/
public void setAutoConnect(boolean autoConnect) {
this.autoConnect = autoConnect;
}
Thanks for every hint!
Beat Friedli