gpt4 book ai didi

list - apache tiles put-list-attribute XML 错误

转载 作者:行者123 更新时间:2023-12-02 15:37:18 24 4
gpt4 key购买 nike

我的 tiles.xml 中有这样的定义:

<definition name="t.base" template="/WEB-INF/tiles/base.jsp">
<put-attribute name="title" value="SomeTitle" />
<put-attribute name="menu" value="/WEB-INF/tiles/menu.jsp" />
<put-attribute name="scripts" value="/WEB-INF/tiles/scripts.jsp" />
</definition>

<definition name="t.homepage" extends="t.base" preparer="com.blogspot.symfonyworld.lyricsbase.controller.TestViewPreparer">
<put-list-attribute name="body">
<add-attribute value="/WEB-INF/jsp/homepage.jsp" />
<add-attribute value="/WEB-INF/tiles/footer.jsp" />
</put-list-attribute>
<put-attribute name="title" value="lyricsBase : home of lyrics" />
<put-attribute name="view" value="homepage" cascade="true" />
</definition>

当处理主页请求时,编译器抛出异常:

org.xml.sax.SAXParseException; lineNumber: 29; columnNumber: 18; The content of element type "definition" must match "(put-attribute*,put-list-attribute*)".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)

我不知道哪里出了问题 - 根据 tiles docs,XML 语法似乎是正确的.

最佳答案

<put-list-attribute>元素必须在定义的末尾,如下所示:

<definition name="t.homepage" extends="t.base" preparer="com.blogspot.symfonyworld.lyricsbase.controller.TestViewPreparer">
<put-attribute name="title" value="lyricsBase : home of lyrics" />
<put-attribute name="view" value="homepage" cascade="true" />
<put-list-attribute name="body">
<add-attribute value="/WEB-INF/jsp/homepage.jsp" />
<add-attribute value="/WEB-INF/tiles/footer.jsp" />
</put-list-attribute>
</definition>

关于list - apache tiles put-list-attribute XML 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15101735/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com