开发者

Apache Tiles Path Root

开发者 https://www.devze.com 2023-03-27 15:42 出处:网络
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:

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?


I think you should use ' ' instead of " ".

0

精彩评论

暂无评论...
验证码 换一张
取 消