You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by krishnamohan <kr...@indosoft.stph.net> on 2003/10/06 15:10:28 UTC

data disappearing in jsp

Hi,

In my jsp page I have 5 fields out of which 2 fields are required.   When
the jsp is submitted I am displaying the error messages for the required
fields using Action Error in the form bean's validate method.  When the jsp
page is displayed with the error messages, the data for the remaining 3
fields is disappearing.  Can anyone let me know why this is happening.   In
the reset method all the fields are made to null.   

Thanks,
Krishna

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: data disappearing in jsp

Posted by Max Cooper <ma...@maxcooper.com>.
If the missing fields are display-only, you might need to add hidden fields
to carry their values along in the request when the page is submitted so
that they will be available on a validation error.

reset() is called before the ActionForm is populated with the values from
the request, so I don't think it matters what you do to them there. As long
as they are in the request (and the names in the HTML form match your
ActionForm), they should be populated in the ActionForm when a validation
error occurs.

-Max

----- Original Message ----- 
From: "krishnamohan" <kr...@indosoft.stph.net>
To: <st...@jakarta.apache.org>
Sent: Monday, October 06, 2003 6:10 AM
Subject: data disappearing in jsp


> Hi,
>
> In my jsp page I have 5 fields out of which 2 fields are required.   When
> the jsp is submitted I am displaying the error messages for the required
> fields using Action Error in the form bean's validate method.  When the
jsp
> page is displayed with the error messages, the data for the remaining 3
> fields is disappearing.  Can anyone let me know why this is happening.
In
> the reset method all the fields are made to null.
>
> Thanks,
> Krishna
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org