lundi 14 avril 2014

How to redirect logged in user to the same page using spring security?


Vote count:

0




I have implemented my website using spring security.


I have added default-target-url in form-login tag:



<security:form-login login-page="/pages/dashboard.action" default-target-url="/welcome.action" authentication-failure-url="/pages/dashboard.action?error=true" />


So when ever user successfully logs in it will be redirected to the page which is defined by mapping given in default-target-url.


But I dont want this, I have log-in button at many places and i want user to directed to the same page from where he is logging in.


Can any one help me with this?


my dispather-servlet.xml:



<security:http use-expressions="true">
<security:intercept-url pattern="/IGG/citizen/*" access="hasRole('IGG_CITIZEN')" />
<security:form-login login-page="/pages/dashboard.action" default-target-url="/welcome.action" authentication-failure-url="/pages/dashboard.action?error=true" />
<security:logout logout-success-url="/pages/dashboard.action" delete-cookies="JSESSIONID" />
<security:anonymous username="guest" granted-authority="ROLE_GUEST"/>
<security:session-management invalid-session-url="/pages/dashboard.action"/>
<security:remember-me/>
<security:access-denied-handler delete-cookies="JSESSIONID"/>
</security:http>


asked 29 secs ago






Aucun commentaire:

Enregistrer un commentaire