我正在使用一个使用Spring Security 2(不是新的)的WebApp,我们没有Java源代码,但是我们可以访问JSP。
从JSP中判断用户是否经过身份验证(任何角色都可以)的最简单方法是什么?
基本上,我想根据用户是否登录显示不同的链接。
我最终使用了SpringSecurityTaglib,security.tld,在这里我可以做到
<authz:authorize ifNotGranted="esp_consumer"> link1 </authz:authorize> <authz:authorize ifAllGranted="esp_consumer"> link2 </authz:authorize>