【问题标题】:Spring Security 2.0, Getting the authentication status of a userSpring Security 2.0,获取用户的认证状态
【发布时间】:2011-03-11 15:38:02
【问题描述】:

我正在开发一个使用 Spring security 2.0(不是新的)的 webapp,我们没有 Java 源代码,但我们可以访问 jsp。

从 jsp 判断用户是否已通过身份验证(任何角色都可以)的最简单方法是什么?

基本上我想根据用户是否登录显示不同的链接。

【问题讨论】:

    标签: authentication jsp spring-security


    【解决方案1】:

    我最终使用了spring security taglib,security.tld,我可以在哪里做

    <authz:authorize ifNotGranted="esp_consumer">
       link1
    </authz:authorize>
    
    <authz:authorize ifAllGranted="esp_consumer">
       link2
    </authz:authorize>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-14
      • 2015-03-11
      • 2012-02-08
      • 2011-04-20
      • 1970-01-01
      • 2012-08-15
      • 2016-08-11
      • 2020-01-05
      相关资源
      最近更新 更多