|
Hi,
My question concerns beans in the request scope and what happens to them
when validation fails. In fact I know they disappear, and that is my problem. I
do not want to use the session scope to store them for the reasons below.
THE CONTEXT
I am on an intranet project where it has been
decided to have very long session time out. We will have quiet a few users on
the system (~ 500), so we want to put our beans (whether forms or other beans)
in the request scope as we don't want to have too many of them in the session
(too much memory would be used too long).
My pages contain some dynamic content, which I pass on to my jsp through
beans (stored in the request). The problem is that when the forms are
validated and fail validation, only the data that is in the form is kept as the
user is redirected to the data-entry page. Any object in the request is
purged.
POTENTIAL SOLUTIONS but not quiet satisfying
The <html:hidden ...> tag:
The beans I use for the dynamic content are too complex to be handled
through the <html:hidden ...> tag, so that is not an option. And
anyway, the form is not a good to put these beans in as they are not
data to be modified by the user.
Using the session scope:
One of the solutions is to use the session scope and remove the beans
from the session once we don't need them anymore. But this can be
easily forgotten and is not obvious to spot. It also reminds me too much of C++.
:(
SO...
So... Is there any way in struts that would allow the data in the request
scope to be reused when validation fails? Or another to organise the lot? Did I
miss something?
|
- Re: Validation errors and scope. Emmanuel Sciara
- Re: Validation errors and scope. Troy Hart
- Re: Validation errors and scope. Emmanuel Sciara

