0

我正在尝试 appfuse,我在 menu.jsp 中添加了一些自定义菜单(在 menu-config.xml 中没有做,因为我想添加一些 glyphicon,而 struts 菜单做不到)

所以对于隐藏/显示菜单,我想使用 spring security 授权标签

<security:authorize access="hasRole('ROLE_ADMIN')">
                         <li>
                            <a href="test.jsp"><i class="fa fa-edit fa-fw"></i> Forms</a>
                        </li>
</security:authorize>

但是这个标签导致Yike!错误(错误 500),控制台中没有显示任何内容。即使我有

<Logger name="org.springframework.security" level="all"/>
<Logger name="org.springframework" level="all"/>

log4j2.xml.

如果我切换到 <security:authorize ifAnyGranted="ROLE_ADMIN"> 它会按预期工作。但是据我所知,ifAnyGranted已弃用。

我很好奇为什么我在输出控制台中看不到错误?

我正在使用 appfuse 3.5 springMVC,与码头一起运行:运行

4

1 回答 1

0

好吧,既然亚历克斯没有给出答案,我会自己发布

我必须在 security.xml 的 http TAG 中添加 use-expressions="true"

例如

于 2015-06-09T21:49:53.143 回答