【问题标题】:<sec:authorize generate Invalid path error with Facelets template<sec:authorize 使用 Facelets 模板生成无效路径错误
【发布时间】:2015-10-16 22:03:22
【问题描述】:

我正在尝试将 Spring Security 与 Facelets 一起使用。 当我在我的页面中使用 sec:authorize 时出现此错误:

<ui:composition template="/template.xhtml"> Invalid path :/template.xhtml

如果我删除&lt;sec:authorize,一切正常

这是我的 Facelets 文件:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:pe="http://primefaces.org/ui/extensions"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core" template="/template.xhtml"
xmlns:sec="http://www.springframework.org/security/tags">

<ui:define name="title">
   HOME  
</ui:define>
<ui:define name="form">
    <p:panelGrid id="homeGrd" columns="4" >
        <f:facet name="header">  
             List of Accounts
            </f:facet>
        <sec:authorize access="hasAnyRole('ROLE_ADMIN')">
        <h:panelGroup layout="block" style="padding: 0 0 3px 0;">

【问题讨论】:

    标签: jsf spring-security facelets


    【解决方案1】:

    我找到了 我用过:

    <sec:authorize ifAnyGranted="ROLE_ADMIN"> 
    

    而不是

    <sec:authorize access="hasAnyRole('ROLE_ADMIN')">
    

    【讨论】:

      猜你喜欢
      • 2015-11-21
      • 1970-01-01
      • 1970-01-01
      • 2023-03-04
      • 2020-10-27
      • 1970-01-01
      • 1970-01-01
      • 2018-03-05
      • 2018-08-25
      相关资源
      最近更新 更多