Why not follow the pattern of the friendbook sample app? Rather than redirect to the login page (which changes the URL in the browser and does all manner of nasty things to the history), why not just forward to a "you need to log in first" page? A complete set of appropriate parameters is easily passed in the model to the log-in-first page.
IMHO, redirects are messy. Jeff Schnitzer [EMAIL PROTECTED] > -----Original Message----- > From: David Cruwys [mailto:[EMAIL PROTECTED] > Sent: Friday, August 01, 2003 10:14 PM > To: [EMAIL PROTECTED] > Subject: [Mav-user] Login with dynamic redirect > > 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] ------------------------------------------------------- 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]
