problem with ActionForm object

2002-07-23 Thread Thomas Praschl

Hi,
I have a simple form on my jsp page. In my ActionForm class I validate whether a 
checkbox was clicked or not. If the checkbox was not clicked an error is returned and 
displayed on the same jsp-page. This works fine but:
Some (not all!) of the properties which were given by the user are not available on 
the error page. 
Furthermore, before I first show the jsp-form I get some information from a database 
which is then stored in the ActionForm bean and therefore displayed in a selectbox. 
After submitting the form and after validation this information is not available on 
the error jsp-page. It seems that the ActionForm object was destroyed too early.

I have already post this problem to the struts user list but nobody could help me. 
Maybe this is a know bug.

Thanks

-
Thomas
[EMAIL PROTECTED]



RE: problem with ActionForm object

2002-07-23 Thread Christopher Book

Your form is probably in the request scope.  If you put your form in the
session scope, then your fields will remain.
The problem is that the form is destroyed and recreated with the fields that
you posted.  Instead of putting lists (for selects) in the form, populate
them every time in the action, or have the getListName method in your form
return the list from your database every time.  Request scope forms are
SUPPOSED to behave in this way.  Once you populate the form and push it to
the page, the request is over.  When the user submits the form, the previous
form is gone and a new one has to be created.

Chris

-Original Message-
From: Thomas Praschl [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 11:47 AM
To: [EMAIL PROTECTED]
Subject: problem with ActionForm object


Hi,
I have a simple form on my jsp page. In my ActionForm class I validate
whether a checkbox was clicked or not. If the checkbox was not clicked an
error is returned and displayed on the same jsp-page. This works fine but:
Some (not all!) of the properties which were given by the user are not
available on the error page. 
Furthermore, before I first show the jsp-form I get some information from a
database which is then stored in the ActionForm bean and therefore displayed
in a selectbox. After submitting the form and after validation this
information is not available on the error jsp-page. It seems that the
ActionForm object was destroyed too early.

I have already post this problem to the struts user list but nobody could
help me. Maybe this is a know bug.

Thanks


-
Thomas
[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]