Nik
Nik

Reputation: 7283

Apache Tiles Path Root

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?

Upvotes: 1

Views: 600

Answers (1)

Nook
Nook

Reputation: 532

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

Upvotes: 1

Related Questions