>   I have some pages on my system who can be called
> from different
> places. The local from where they was called will
> determine the next
> page to show.
>   One example of this is the login action. It can be
> called when the
> user press the "login" link on a application page. On
> this case after
> the login is finished the next page show is the main
> site page.
>   But when it is called to authenticate the user who
> is doing the
> checkout the page to be show is another.
>   What is the best practice to handle this type of
> problem ?
>

A simple way to do it :
you should define 2 actionMapping
first one for "login", second one for "checkout"
the two use your LoginAction class and forward to success
"success" = Menu.sjp on mapping 1
"success" = Other on mapping 2

A second way to do it:
add a hidden input on your form (let's call it "dispatch"). This is a
very common way to
have different behaviour from the same action.
then define 2 forwards :
"login" => Menu.jsp
"checkout" => Other.jsp
in LoginAction, use dispatch value to get successful ActionForward.


For such a case you don't need to "forward parameter" to another
action. Your action just need to know in which case it is used (using
2 mappings or based on a form input)

Nico.


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

Reply via email to