如何将springsecurity登陆成功后返回原来登录前页面
1个回答
展开全部
<http use-expressions="true">
<intercept-url pattern="/**/*.do" access="hasAnyRole('user', 'admin')" />
<intercept-url pattern="/**/*.jsp" access="isAuthenticated()" method="GET" />
<form-login login-page="/login.jsp" />
<remember-me />
<logout logout-success-url="/loggedout.jsp" delete-cookies="JSESSIONID"/>
<session-management invalid-session-url="/timeout.jsp">
<concurrency-control max-sessions="5" error-if-maximum-exceeded="true" />
</session-management>
<custom-filter ref="mySecurityFilter" before="FILTER_SECURITY_INTERCEPTOR"/>
</http>
我记得我这样配好像能登录后自动回到最后访问的页面的.
form-login中还可以加上:
<b><form-login login-page='/login.htm' default-target?-url='/home.htm'
always-use-default-target='true' /></b>
default-target-url不要配.always-use-default-target为false 试试
<intercept-url pattern="/**/*.do" access="hasAnyRole('user', 'admin')" />
<intercept-url pattern="/**/*.jsp" access="isAuthenticated()" method="GET" />
<form-login login-page="/login.jsp" />
<remember-me />
<logout logout-success-url="/loggedout.jsp" delete-cookies="JSESSIONID"/>
<session-management invalid-session-url="/timeout.jsp">
<concurrency-control max-sessions="5" error-if-maximum-exceeded="true" />
</session-management>
<custom-filter ref="mySecurityFilter" before="FILTER_SECURITY_INTERCEPTOR"/>
</http>
我记得我这样配好像能登录后自动回到最后访问的页面的.
form-login中还可以加上:
<b><form-login login-page='/login.htm' default-target?-url='/home.htm'
always-use-default-target='true' /></b>
default-target-url不要配.always-use-default-target为false 试试
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询