Spring security to recover the user name after intercept
我有一个登录表单,该表单张贴到acegi-security截获的URL上,但是我希望可以在服务器上的某个位置访问用户名。有什么我可以做的吗?
编辑
使用acegi-security-1.0.3
谢谢
在这里看看:http://java-x.blogspot.com/2006/12/spring-security-with-acegi-security.html
您应该能够通过获取Authentication来从SecurityContextHolder上下文中获取用户名。
1 | <%= SecurityContextHolder.getContext().getAuthentication().getName() %> |