[Struts] Init formbean value before Initialisation?  
Author Message
Wendy S





PostPosted: 2003-6-28 9:09:00 Top

java-programmer, [Struts] Init formbean value before Initialisation? Daniel Cloutier wrote:
> i've got 2 actions, 2 forms and 2 jsps... on jsp1 i receive userinput
> (e.g. the username) and i want to show it in the form on the next jsp
> (in a text-component). how can i accomplish this without scriptlets?
> can i access the second formbean in the action of the first jsp?

Please post some of your code. It's easier to talk about this using real
names of Action classes and Forms.

I'm guessing Action1 fortwards to JSP1 which has the username field (a
login form?) When you submit that, it goes back to Action1, which sees
that the value is present and forwards where?

--
Wendy in Chandler, AZ
"BTW, Lucifer just called and he needs a pair of ice skates :-)"
James Turner on struts-dev, voting to release Struts 1.1 Final
 
Xavier Tarrago





PostPosted: 2003-6-30 17:09:00 Top

java-programmer >> [Struts] Init formbean value before Initialisation? You could use the same form bean for the two actions. It is a common usage.
You form bean should be in the session scope. It will be used by successive
actions across a multi form transaction.
There are some subtil isues if the user initiates two transactions with the
same client. For instance, with netscape, if you open a new windows from
your form, you get another instance of the same form in the same session. It
can be tricky to manage...

"Daniel Cloutier" <email***@***.com> a 閏rit dans le message news:
email***@***.com...
> hi,
>
> i've got 2 actions, 2 forms and 2 jsps... on jsp1 i receive userinput
> (e.g. the username) and i want to show it in the form on the next jsp
> (in a text-component). how can i accomplish this without scriptlets?
> can i access the second formbean in the action of the first jsp?
>
> thx in advance
> dan