Login with dynamic redirect

"David Cruwys" <[email protected]>
Newsgroups gmane.comp.web.maverick.general
Message-ID <[email protected]>
Scenario 1

User types http://host/app/protectedCommand.m, the protected command sees
that the user
is not logged in so redirects them to login screen, when the user has logged
in successfull
the loggin can return either SUCCESS or if a redirect property is set, the
login can redirect
to desired screen

      <command name="prt.login">
         <controller
class="com.muesliflakes.webapp.portal.ctl.PrtLoginCmd"/>

         <view name="display" path="prt.login.vm">
            <transform path="menu_header.vm"/>
         </view>

         <view name="success"    type="redirect" path="prt.home.m"/>
         <view name="close"      type="redirect" path="prt.home.m"/>
         <view name="redirect"   type="redirect"/>

      </command>

I can get this working with the following code.

   public String execute( BaseForm formBean, ControllerContext cctx ) throws
Exception
   {
	   try
         {
            // Authenticate Code...Throw exception if login failed...

            if ( ! StrUtil.isEmpty( formBean.getRedirect( ) ) )
            {
               cctx.setModel( formBean.getRedirect( ) );
               return "redirect";
            }
            return SUCCESS;
         }
         catch ( SignInException e )
         {
         }
      }

Scenario 2,

User types http://host/app/protectedCommand.m?p1=v1&p2=v2&p3=v3

Same idea, user is redirected to login and then if login is successfull they
should be redirected through to initially selected command, only this time
there are a number of URL paramters that I wish to have set, Does anyone
have a simple way of acheiving this functionality.

Cheers Dave




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
[INVALID FOOTER]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.