Apache Tiles 路径根
我正在使用 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
的其他用途也可以工作,尽管它们不在这样的属性中。当我加载页面时,我的图像源实际上是
I am using Tiles 2 and I want to have an attribute that sets the root path for resources. I have this is my 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>
This is a base definition that I will extend other pages from. In the 'titledWrapper.jsp' page, I have this:
<img src="<tiles:getAsString name="pathRoot" />statics/images/corner.gif" />
I am also importing the Tiles tag lib. Other uses of getAsString
work, though they are not in an attribute like this. When I load the page, my image source is literally <tiles:getAsString name="
. What do I need to do differently to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你应该使用“”而不是“”。
I think you should use ' ' instead of " ".