开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜