I have a problem with saving checkbox value into some bean. With other stuff like text etc all is ok. Also I don’t have any problems if I save checkbox value to MyAction class.
Problem only appears when I try to do so with some bean in my class.
example jsp:
<s:form>
<s:checkbox name="myBean.flag"/>
<s:submit/>
</s:form>
======
example java code:
public class MyAction extends Action {
private MyBean myBean;
public MyBean getMyBean(){
if(myBean == null){myBean = new MyBean();}return myBean;}
}
public void setMyBean(MyBean myBean){this.myBean = myBean;}
}
…
public class MyBean {
private boolean flag;
public MyBean isFlag(){return flag;}
public void setFlag(boolean flag){this.flag = flag;}
}
======
P.S. Seems that I have more less the same problem as this guy have:
http://www.coderanch.com/t/448207/Struts/Struts-Checkbox-set-value-back
correct
aFlagtoflagand addvalueof thecheckboxin:to:
But in your
MyActionclass code just edit: