You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "YOUSFI, Zahi" <Z....@bouygues-construction.com> on 2001/03/15 14:54:59 UTC

how to use Automatic Form Validation in this case ?

Hi all,
I have an Action that create in the request scope a javabean.
the action mapping for this action is a forward to a jsp.
The javabean contains a vector of string and it is used in the jsp to create
a select element in a form.
When the ActionForm validate method is called the javabean is not any more
valid.
If there are errors the controller servlet will forward control back to the
jsp. 
The jsp will not find the javabean to display the form properly.

the first idea is to put the javabean in the session scope.

Some one have an other idea?
thx for help,


Cordialement,

Zahi YOUSFI
Structis (GIE Informatique Bouygues Construction)
Tél : 01 30 60 41 89 - Fax : 01 30 12 11 14
z.yousfi@bouygues-construction.com


Re: how to use Automatic Form Validation in this case ?

Posted by Maya Muchnik <mm...@pumatech.com>.
I do not know an answer to your question. But a lot of examples and answers in
this email archive. Try to search for "iteration" or "iterate".
Here is a link:
http://www.mail-archive.com/struts-user@jakarta.apache.org/

"YOUSFI, Zahi" wrote:

> Hi all,
> I have an Action that create in the request scope a javabean.
> the action mapping for this action is a forward to a jsp.
> The javabean contains a vector of string and it is used in the jsp to create
> a select element in a form.
> When the ActionForm validate method is called the javabean is not any more
> valid.
> If there are errors the controller servlet will forward control back to the
> jsp.
> The jsp will not find the javabean to display the form properly.
>
> the first idea is to put the javabean in the session scope.
>
> Some one have an other idea?
> thx for help,
>
> Cordialement,
>
> Zahi YOUSFI
> Structis (GIE Informatique Bouygues Construction)
> Tél : 01 30 60 41 89 - Fax : 01 30 12 11 14
> z.yousfi@bouygues-construction.com


Re: how to use Automatic Form Validation in this case ?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 15 Mar 2001, YOUSFI, Zahi wrote:

> 
> Hi all,
> I have an Action that create in the request scope a javabean.
> the action mapping for this action is a forward to a jsp.
> The javabean contains a vector of string and it is used in the jsp to create
> a select element in a form.
> When the ActionForm validate method is called the javabean is not any more
> valid.
> If there are errors the controller servlet will forward control back to the
> jsp. 
> The jsp will not find the javabean to display the form properly.
> 
> the first idea is to put the javabean in the session scope.
> 

That's a good idea, if the set of options are specific to this user.  If
the set of options for this select box are global to everyone, you might
want to create a servlet context attribute (in JSP terms, an "application
scope bean") when the application starts up.  Then you would not have to
look up the options every time.

> Some one have an other idea?
> thx for help,
> 
> 
> Cordialement,
> 
> Zahi YOUSFI

Craig
>