转载:[url]http://blog.youkuaiyun.com/bukebushuo[/url]
SS2不仅仅把登录的部分给你做了,还给你做了登出的部分。
在xml中配置如下登出后显示页面
<http>
...
...
<logout logout-success-url="/login.jsp"/>
</http>
然后在登录后的任意页面比如说某个链接
设置为如下
<a href="<%= request.getContextPath() %>/j_spring_security_logout" target="_top">注销</a>
target部分可以省略,如果你不是在一个frame页面中的话
那么剩下的就OK了。
SS2不仅仅把登录的部分给你做了,还给你做了登出的部分。
在xml中配置如下登出后显示页面
<http>
...
...
<logout logout-success-url="/login.jsp"/>
</http>
然后在登录后的任意页面比如说某个链接
设置为如下
<a href="<%= request.getContextPath() %>/j_spring_security_logout" target="_top">注销</a>
target部分可以省略,如果你不是在一个frame页面中的话
那么剩下的就OK了。
本文介绍如何使用 SS2 进行登录与登出的配置,包括 XML 中的配置示例及登录成功后页面上的登出链接设置。
640

被折叠的 条评论
为什么被折叠?



