struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kedar Choudhary" <ked...@helixtechsolutions.com>
Subject RE: about current action name acsess
Date Sat, 01 Mar 2008 17:28:48 GMT
Well, I'm not sure why the %{#postLoginURL} did not work for you.
Glad that you got it working using session as storage.
The issues in using session as storage for postLoginURL are pretty minor in
nature:

1) un-authenticated user tries to access privileged URL, say
/privileged.action, he is sent to login screen, but he navigates out to some
other page and then from elsewhere in the site clicks on "Login" link. In
such case, after successful login he should be taken to home page as he has
initiated the login. But using session to store postLoginURL, user will be
sent to the /privileged.action.
 
2) user has two browser windows open, in window-1 he tries to access
/privileged-1.action is taken to login page, he does not immediately
complete the login. In window-2, he tries to access /privileged-2.action is
taken to login page, does not complete the login here. He returns to
window-1 and completes the login. He returns to window-1 and completes the
login. Here he should be taken to /privileged-1.action but actually will be
taken to /previlged-2.action

3) user tries to access /previlged.action, is taken to login page, but user
goes for lunch break, completes the login after lunch break. He is taken to
home page as his session is gone by the time he completes the login.

In fact, there is one issue with the solution I was using.
It would not take user to postLoginURL if user makes a mistake in first
login attempt but succeeds second time. Following changes to the solution
given earlier will correct this issue:

=================
struts.xml
    <global-results>
      <result name="login" type="chain">
	  <param name="actionName">login_input</param>
	  <param name="postLoginURL">${postLoginURL}</param>
	</result>
    </global-results>

login.jsp
  <s:form label="Login" action="login">
    <s:textfield key="loginId" />
    <s:password key="password" />
    <s:hidden name="postLoginURL" value="%{postLoginURL}"></s:hidden>
    <s:submit />
  </s:form>
============

Regards,
Kedar

-----Original Message-----
From: hns [mailto:hardik_982@yahoo.com] 
Sent: Saturday, March 01, 2008 12:01 PM
To: user@struts.apache.org
Subject: Re: about current action name acsess


After Inspecting postLoginURL I have found that entry of ctx hashtable
PostLoginURL remains in it but it can not come at Login.java(getter and
setter of PostLoginURL)
so i think some thing missing in it or wrong at login.jsp so value can not
come after submitting form at login.java 
-- 
View this message in context:
http://www.nabble.com/about-current-action-name-acsess-tp15736383p15773060.h
tml
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message