为什么 sec:authorize 不起作用?

发布于 2024-11-16 04:00:09 字数 280 浏览 6 评论 0原文

我有一个基于 Facelets 的 JSF 2 页面,并在应用程序后面使用 Spring Security 3。当我在页面中放置一些像这样的标签时:

<sec:authorize  access="hasRole('SS')" >
<h:outputText value="X" /></sec:authorize>

X 无论如何都会在运行时显示。 Eclipse 的自动完成功能可以在编程时正确显示“sec:”标签及其属性。有什么问题吗?

I have a JSF 2 page based on Facelets and use Spring Security 3 behind the application. When I put some tags like this within my page:

<sec:authorize  access="hasRole('SS')" >
<h:outputText value="X" /></sec:authorize>

the X will display at runtime anyway. The auto completion feature of eclipse work correctly to show the "sec:" tags and their properties at programming time. what's the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若有似无的小暗淡 2024-11-23 04:00:09

你有:

<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

在文件的顶部吗?

此外,您还需要在 securityBeans.xml 的 http 标记中使用 use-expressions="true"。这样做意味着 securityBeans 中或任何地方的任何旧样式 access="ROLE_BLAH" 标记也需要更改为使用表达式。

Have you got:

<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

at the top of the file?

Also, you need use-expressions="true" in the http tag in securityBeans.xml. Doing this means that any old style access="ROLE_BLAH" tags in securityBeans or wherever also need to change to use expressions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文