【问题标题】:How to solve cvc-complex-type.2.4.d: Invalid content error in .taglib.xml file Macbook M1如何解决 cvc-complex-type.2.4.d: Invalid content error in .taglib.xml 文件 Macbook M1
【发布时间】:2021-04-27 01:03:18
【问题描述】:

我尝试更新 maven 项目,但在 .taglib.xml 文件中出现错误。在 windows 计算机中,此错误不会出现,但它发生在我的 macbook 中。请看下图。

taglib.xml 文件中的这段代码。

<?xml version="1.0" encoding="UTF-8"?>
<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
                version="2.0">
    
    <namespace>http://primefaces.org/babylon</namespace>
    
    <tag>
        <description><![CDATA[Menu is a navigation component for Babylon Layout.]]></description>
        <tag-name>menu</tag-name>
        <component>
            <component-type>org.primefaces.component.BabylonMenu</component-type>
            <renderer-type>org.primefaces.component.BabylonMenuRenderer</renderer-type>
        </component>
        <attribute>
            <description><![CDATA[Unique identifier of the component in a namingContainer.]]></description>
            <name>id</name>
            <required>false</required>
            <type>java.lang.String</type>
        </attribute>
        <attribute>
            <description><![CDATA[Boolean value to specify the rendering of the component, when set to false component will not be rendered.]]></description>
            <name>rendered</name>
            <required>false</required>
            <type>java.lang.Boolean</type>
        </attribute>
        <attribute>
            <description><![CDATA[An el expression referring to a server side UIComponent instance in a backing bean.]]></description>
            <name>binding</name>
            <required>false</required>
            <type>javax.faces.component.UIComponent</type>
        </attribute>
        <attribute>
            <description><![CDATA[Name of the client side widget.]]></description>
            <name>widgetVar</name>
            <required>false</required>
            <type>java.lang.String</type>
        </attribute>
        <attribute>
            <description><![CDATA[A menu model instance to create menu programmatically.]]></description>
            <name>model</name>
            <required>false</required>
            <type>org.primefaces.model.menu.MenuModel</type>
        </attribute>
        <attribute>
            <description><![CDATA[Inline style of the main container element.]]></description>
            <name>style</name>
            <required>false</required>
            <type>java.lang.String</type>
        </attribute>
        <attribute>
            <description><![CDATA[Style class of the main container element.]]></description>
            <name>styleClass</name>
            <required>false</required>
            <type>java.lang.String</type>
        </attribute>
        <attribute>
            <description><![CDATA[Whether the orientation of the menu is horizontal.]]></description>
            <name>horizontal</name>
            <required>false</required>
            <type>java.lang.Boolean</type>
        </attribute>
        <attribute>
            <description><![CDATA[When enabled, scroll state is saved in a cookie for the session. Default is true.]]></description>
            <name>statefulScroll</name>
            <required>false</required>
            <type>java.lang.Boolean</type>
            <defaultValue>true</defaultValue>
        </attribute>
    </tag>
</facelet-taglib>

我不确定父项目的 pom.xml 中的依赖库是否没有添加到子项目中?

【问题讨论】:

    标签: eclipse macos maven


    【解决方案1】:

    我想您会发现那里不允许使用defaultValue。我不确定它是否已宣布。如果您将鼠标悬停在“属性”标签的名称上,悬停信息将显示那里的合法内容。您必须将其删除,并且当您希望 statefulScroll 成为 true 时,将其设置为这样。

    【讨论】:

    • 感谢您的信息。我只知道真正的问题是在我通过 mvn update、clean 和 install 构建项目之后,但是 pom.xml 的 maven 资源插件的目录路径中的一些资源没有构建在目标文件夹中,所以一些库还没有和 taglib.xml不能打电话给他们。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-09
    • 2020-11-21
    相关资源
    最近更新 更多