Per Jørgen Walstrøm wrote:
hello,
I am trying to do a tiles:put on a tag without an ending-tag. Like this
(layoutSearch.jsp):
<tiles:put name="showPlus30Start" direct="true">
<logic:equal property="searchPlus30" name="searchForm" value="true">
</tiles:put>
<tiles:put name="showTempEndTag" direct="true">
</logic:equal>
</tiles:put>
these attributes are supposed to be used in a jsp like this:
<tiles:insert attribute="showPlus30Start" ignore="true"/>
<bean:message key="temperature.plus30"/>
<tiles:insert attribute="showTempEndTag" ignore="true"/>
The exception I get, looks like this:
2006-01-25 13:48:19,568 ERROR [ResourceFilter] Exception in resource filter.
javax.servlet.ServletException: ServletException in '/unprotected/layouts/layout.jsp':
ServletException in '/unprotected/layouts/layoutSearch.jsp':
/unprotected/layouts/layoutSearch.jsp(15,4) The end tag "</tiles:put" is
unbalanced
This does apparently not work, as the <logic:equal> is not correctly ended in my <tiles:put>...
is there a way to tell struts/tiles to get this to work?
No, not like that; as you've discovered, tags must be properly nested.
The right way to do this is to define a tile with both the logic:equal
start tag and end tag, wrapped around a placeholder. Something like
(very roughly)
<tiles:put name="showPlus30">
<tiles:insert name="message"/>
</tiles:put>
...
<tiles:insert name="showPlus30">
<tiles:put name="message">
<bean:message .../>
</tiles:put>
</tiles:insert>
I don't use the Tiles taglib (I do everything through tiles-defs.xml) so
that markup is probably way off, but hopefully you get the idea...
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]