Hi!

I am trying to get Shale Tiles to work with JSF 1.2_04 (RI), and I have some
problems concerning injecting a tile into my template.

I have tried to make a small example application using the JBoss hellojsf
example, in order to have a working demo before upgrading my production
site.

I have the following:
template.jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"; %>
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"; %>
<html>
 <head><title>Simple jsp page</title></head>
 <body>
   <f:view>
     This is a simple test
     <f:subview id="content">
       <tiles:attribute name="body" flush="false"/>
     </f:subview>
   </f:view>
 </body>
</html>

What I want to do is to inject the content of my index.jsp page in the place
of the body attribute.
I have defined the following in the tiles-definitions.ml:
<?xml version="1.0"?>

<!DOCTYPE tiles-definitions PUBLIC
 "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
 "http://struts.apache.org/dtds/tiles-config_2_0.dtd";>

<tiles-definitions>
 <definition name="/layout" template="/template.jsp">
   <put name="body"            value="" />
 </definition>

 <definition name="/index" extends="/layout" >
   <put name="body" value="/index.jsp" />
 </definition>

</tiles-definitions>

in my web.xml I have added the tiles listener:
 <listener>
   <listener-class>org.apache.tiles.listener.TilesListener</listener-class>
 </listener>

and also mapped the jsf extension to the faces servlet:
  <servlet-mapping>
     <servlet-name>Faces Servlet</servlet-name>
     <url-pattern>*.jsf</url-pattern>
  </servlet-mapping>


When I hit the index.jsf URL of the deployed application all I get is the
content of the template.jsp except for the parts inside the <f:view> tag.

So it seems that tiles is correctly loading the template, but I some how
failed to make the correct configuration of how to insert the parts coming
from index.jsp. Can any one see what I am doing wrong?

I'm using the files from Shale Framework 1.0.4 (shale-tiles.jar and
tiles-core.jar).

Best regards,
Mads

Reply via email to