java Apache路径根
我正在使用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>
这是一个基本定义,我将从中扩展其他页面。在书名包装里。jsp的页面,我有以下内容:
<img src="<tiles:getAsString name="pathRoot" />statics/images/corner.gif" />
我还导入了Tiles标签库。getAsString
的其他用法也适用,尽管它们不在这样的属性中。当我加载页面时,我的图像源实际上是<tiles:getAsString name="
。我需要采取什么不同的措施来解决这个问题
# 1 楼答案
我认为你应该用“”而不是“”