How to remember last visited page?
How to after login enter the page which was visited last before logout?
Here is security config:
Code:
<security:http auto-config="true">
<security:intercept-url pattern="/login.action" filters="none"/>
<security:intercept-url pattern="/res/**" filters="none"/>
<security:intercept-url pattern="/admin/**" access="ROLE_ADMIN"/>
<security:intercept-url pattern="/**" access="ROLE_USER"/>
<security:access-denied-handler error-page="/denied.action"/>
<security:form-login login-page='/login.action'
authentication-failure-url="/login.action?login_error=1"
default-target-url='/dashboard.action'/>
</security:http>
<security:authentication-manager>
<security:authentication-provider ref="portalAuthenticationProvider"/>
</security:authentication-manager>
<bean id="portalAuthenticationProvider" class="com.colvir.portal.security.PortalAuthenticationProvider">
<property name="userService" ref="userService"/>
</bean>
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"
p:targetClass="org.springframework.security.core.context.SecurityContextHolder"
p:targetMethod="setStrategyName" p:arguments="MODE_INHERITABLETHREADLOCAL"/>
Now I always hit dashboard.action after login.
(As you can see always-use-default-target isn't set.)