vpsangeetha wrote:
Hi,
I have a jsp page(test.jsp) and a custom form that extends DynaActionForm(TestForm.java) associated with it for validation. tesp.jsp populates the fields in the form to be displayed using an object(TestObject.java) stored in the request. When a validation error happens, it is supposed to go back to test.jsp. But I get an error since the request no longer has TestObject.java.
How do I deal with this problem? Currently I am repopulating TestObject and storing it in the request before returning the errors in the validate method of TestForm. Is there any other way to do this?
Thanks for ur input.
Sangeetha.
Sangeetha,
The typical way to do this would be to store your object in a 'longer lived' scope, e.g. the session. In your case, there are a few tacts you can take. You can store it in the session and upon successful validation in TestForm, remove the object from the session (that way it doesn't hang around any longer than you need it to). Alternately, you can make the object part of your TestForm, which will always be available to the JSP. Out of curiosity, if you have this need to pre-populate a form, why are you using the DynaActionForm? It would seem that you could simply make TestObject into your form bean and then your problems would go away.
Respectfully, Brice Ruth
-- Brice Ruth, Sr. IT Analyst Fiskars Brands Inc http://www.fiskarsbrands.com/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]