views:

26

answers:

1

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 not.

A: 

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