We have Tiles 2.0.4 working in an app with Struts-1, Struts-2, and JSF.
The deployment descriptors for all that are pretty complex, but I
believe that the missing part of your deployment is the Shale-Tiles view
handler, which is not actually a Shale-specific function, but works with
any JSF implementation. The problem is that the Shale-Tiles view
handler, available from the Shale site has not been updated in a year,
and doesn't work with the latest Tiles versions. In order to use Tiles
with JSF, we needed to update the code. If you email me, I have been
OK'd to send people the code. It is just one java class. Then you'd
need to create the jar file.
In faces-config.xml you need this element:
<application>
<locale-config><default-locale>en_US</default-locale></locale-config>
<view-handler>
org.apache.shale.tiles.TilesViewHandler
</view-handler>
</application>
and then you need the shale-tiles.jar file in the WEB-INF/lib directory.
- Ray Clough
Chris Pratt wrote:
I'm trying to get a simple app running with MyFaces 1.1.5 and Tiles 2.0.4, but
it's not working.
I have the standard web.xml file that defines the TilesListener and
MyFaces StartupServletContextListener. It also has the
TilesDispatcherServlet (mapped to *.tiles) and the FacesServlet
(mapped to *.jsf)
My WEB-INF\tiles.xml contains one definition (note the template ends in .jsf):
<definition name="index" template="/layout/layout.jsf">
<put-attribute name="title" value="Crash Test Dummy" type="string"/>
<put-attribute name="bodyContent" value="/body/body.jsp" type="template"/>
</definition>
And the WEB-INF\faces-config.xml contains one navigation-rule:
<navigation-rule>
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/home.jsp</to-view-id>
</navigation-case>
</navigation-rule>
The welcome-file is mapped to index.jsp that simply contains:
<%@ page session="false"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<tiles:insertDefinition name="index"/>
The layout simply imports the f and tiles taglibs, encloses everything
in <f:view> tags and inserts the bodyContent attribute (which is a
.jsp file with only one <p> of text in it).
But when I try to run the attached war file I get about 8000+ lines of
stack trace that mean absolutely nothing to me.
Has anybody been able to get this working? I'd really appreciate some
pointers, I've been struggling with this for a couple of days already.
The war file containing everything here is at
http://www.planetpratt.com/xfer/crash.war
Thanks
(*Chris*)