Re: [Mav-user] Login with dynamic redirect

2003-08-02 Thread Taavi Tiirik
 Scenario 2,

 User types http://host/app/protectedCommand.m?p1=v1p2=v2p3=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.

David,

I dont know if you find it simple or elegant. My feeling is that it is not.
Anywhay
this is what I do:

in authentication-form.jsp I populate hidden fields into login form like
this:

 c:forEach items=${paramValues} var=paramValue
  c:forEach items=${paramValue.value} var=v
   c:if test=${paramValue.key != 'loginName'  paramValue.key !=
'loginPassword'}
input type=hidden name=c:out value=${paramValue.key}/
value=c:out value=${v}//
   /c:if
  /c:forEach
 /c:forEach

This code filters out loginName and loginPassword since they are defined as
an
ordinary input fields.

I have this working with registration too. Ie. the user may happen to our
site, submit a
search form (not being logged in yet), find out that registration is needed,
register, and
then get search results. It really is necessary to remember these get or
post parameters
especially if session expires and user has filled in an input form and does
not want to
retype everything again.

with best wishes,
Taavi



---
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/psa0013ave/direct;at.aspnet_072303_01/01
[INVALID FOOTER]


Re: [Mav-user] Login with dynamic redirect

2003-08-02 Thread Mike Moulton

Scenario 2,

User types http://host/app/protectedCommand.m?p1=v1p2=v2p3=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.
David,

In general I usualy have a 'MasterController' that is extended by 
'protectedCommand'. If the master controller determines that 
'protectedCommand' requires a login, and the user is not yet logged in, 
then I re-assemble the url used to access this page, store it in a 
session value and redirect to the login controller. Upon successful 
login the login page looks to see if the session value is set, if so it 
redirects to that page.

Another way is to have your login controller look at the referrer, 
analyze it to see if it came from within your application, if so, save 
it in the session and redirect to it upon successful login.

-- Mike



---
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/psa0013ave/direct;at.aspnet_072303_01/01
[INVALID FOOTER]