首页 文章

使用primefaces premium主题时faces-config.xml和primefaces-sentinel.taglib.xml出错

提问于
浏览
1

我正在使用Primefaces Premium主题我在其类路径中添加了必要的jar但遇到了一个我无法调试的错误,因为它似乎与java无关但xml / jsf相关

faces-config.xml

在此行找到多个注释: - cvc-pattern-valid:值'primefaces-sentinel'对于模式'($ || \ p )(\ p | \ p不是facet-valid || $)*'表示'null' . - cvc-complex-type.2.2:元素'name'必须没有元素[children],并且该值必须有效 .

primefaces-sentinel.taglib.xml

cvc-complex-type.2.4.a:从元素'description'开始发现无效内容 . 其中一个'{“http:// java.sun.com/xml/ns/javaee":handler-class,,http://java.sun.com/xml/ns/javaee":behavior,"http:/ / java.sun.com/xml/ns/javaee":component,"http://java.sun.com/xml/ns/javaee":converter,"http:// java.sun.com/xml/ns / javaee“:validator,”http://java.sun.com/xml/ns/javaee":source}'是预期的 .

1 回答

  • 2

    不幸的是,您没有显示导致问题的代码 . 所以它是根据错误消息猜测的 .

    faces-config.xml在此行找到多个注释: - cvc-pattern-valid:值'primefaces-sentinel'对于模式'($ || \ p )而言不是facet-valid(\ p {对于'null'类型,L} | \ p || $)*' . - cvc-complex-type.2.2:元素'name'必须没有元素[children],并且该值必须有效 .

    那么,你在 faces-config.xml 中有以下元素吗?

    <name>primefaces-sentinel</name>
    

    给定正则表达式模式 ($|| \p{L})(\p{L}|\p{Nd}||$)* ,连字符在 <name> 元素中确实无效 .

    删除连字符或使用与给定模式匹配的其他名称:

    <name>sentinel</name>
    

    primefaces-sentinel.taglib.xml cvc-complex-type.2.4.a:从元素'description'开始发现无效内容 . 其中一个'{“http://java.sun.com/xml/ns/javaee":handler-class,,http://java.sun.com/xml/ns/javaee":behavior,"http:/ /java.sun.com/xml/ns/javaee":component,"http://java.sun.com/xml/ns/javaee":converter,,http://java.sun.com/xml/ns / javaee“:validator,”http://java.sun.com/xml/ns/javaee":source}'是预期的 .

    <tag-name> 在预期元素列表中缺失,因此您在 primefaces-sentinel.taglib.xml 中有以下排序?

    <tag>
        <tag-name>...</tag-name>
        <description>...</description>
        ...
    </tag>
    

    给定XSD文件中定义的预期元素排序,这确实是无效的 .

    在他们周围交换:

    <tag>
        <description>...</description>
        <tag-name>...</tag-name>
        ...
    </tag>
    

相关问题