1

我正在使用 Tiles 2,我想要一个属性来设置资源的根路径。我有这是我的 XML:

<definition name="titledWrapper" template="/WEB-INF/templates/titledWrapper.jsp">
        <put-attribute name="includes" value="/WEB-INF/templates/includes.jsp" />
        <put-attribute name="navigation" value="/WEB-INF/templates/navigation.jsp" />
        <put-attribute name="body" value="" />
        <put-attribute name="pathRoot" value="./" type="string" />
</definition>

这是一个基本定义,我将从中扩展其他页面。在“titledWrapper.jsp”页面中,我有这个:

<img src="<tiles:getAsString name="pathRoot" />statics/images/corner.gif" />

我也在导入 Tiles 标签库。工作的其他用途getAsString,尽管它们不在这样的属性中。当我加载页面时,我的图像源字面上是<tiles:getAsString name=". 我需要做些什么来解决这个问题?

4

1 回答 1

1

我认为您应该使用“”而不是“”。

于 2011-08-11T12:58:35.927 回答