Hi everyone,
I don't understand the way
struts treats the ActionForm bean in Struts 1.3. This is how it goes...
I have a <html:form action="/myaction.do"><html:text property="myinteger"/></html:form>. I understand that this creates a new ActionForm bean with a type and a scope specified in struts-config.xml if the bean doesn't already exist.
The ActionForm bean I'm using has an Integer attribute which I want to have value -1 if no value was introduced in the form.
The first time I present the
jsp page that has the <html:form> nothing appears in that <html:text property="myinteger"/> as I expect because the ActionForm bean has just been created and that Integer property has a default value of null.
My problem is that in my MyAction class, the first time I get my AtionForm subclass
something(this is what I'm trying to find out) has assigned a default value of 0 to my Integer property which I was expecting to still be null.
I tried to prevent this by chaning the myinteger setter in my ActionForm subclass to:
but when debugging the setter method already comes with a 0.
Thanks!