Spring Security 2.0, Getting the authentication status of a user
I am working on a webapp which uses Spring security 2.0 (not the new one), which we don't have the Java sources, but we do have access to the jsp.
What is the easiest way to tell if a user is authenticated (any role will do) from the jsp?
Basically I want to display a different link depending on whether a user logged in or开发者_StackOverflow not.
I ended up using spring security taglib, security.tld, where I can do
<authz:authorize ifNotGranted="esp_consumer">
link1
</authz:authorize>
<authz:authorize ifAllGranted="esp_consumer">
link2
</authz:authorize>
精彩评论