2009/6/22 Chris Dailey <[email protected]>

> I just discovered the page describing Wildcard support, and was wondering
> if it could be applied to this problem.
> http://tiles.apache.org/framework/tutorial/advanced/wildcard.html
>
> I am guessing I would want to:
>
> <definition name="standardHdr.*:--:*"
> template="/template/standardHeader.jsp">
>  <put-attribute name="header" value="/template/header.jsp"/>
>  <put-attribute name="leftnav" value="/template/leftnav.jsp"/>
>  <put-attribute name="footer" value="/template/footer.jsp"/>
>  <put-attribute name="content" value="{1}"/>
>  <put-attribute name="title" value="{2}"/>
> </definition>
>
> page1.jsp:
> <tiles:insertDefinition name="standardHdr./page1content.jsp:--:Page One
> Content"/>
> page1content.jsp:
> (contains whatever the content is)
>
> I don't have to add an extra definition for each page, but there are still
> 2 JSP pages for every page that uses that definition.
>
> Please let me know whether there is a 1-page solution.
>


You can use the ViewHandler that Apache Myfaces provides:
http://myfaces.apache.org/tomahawk/tiles.html

But you have to use this view handler (don't know if it works though):
http://myfaces.apache.org/tomahawk-project/tomahawk12/apidocs/org/apache/myfaces/tomahawk/application/jsp/JspTilesTwoViewHandlerImpl.html

This way you can specify the name of the definition as the view id.

HTH
Antonio

Reply via email to