SS2不仅仅把登录的部分给你做了,还给你做了登出的部分。
在xml中配置如下登出后显示页面
<http>
...
...
<logout logout-success-url="/login.jsp"/>
</http>
然后在登录后的任意页面比如说某个链接
设置为如下
<a href="<%= request.getContextPath() %>/j_spring_security_logout" target="_top">注销</a>
target部分可以省略,如果你不是在一个frame页面中的话
那么剩下的就OK了。