struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas De Loof" <>
Subject Re: Re[2]: How to use forward parameters ? Newbie
Date Wed, 19 Mar 2003 13:02:32 GMT
>   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)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message