I forgot to include what you also need in faces-config as follows:

<!-- Tiles Integration -->
  <application>    
    <view-handler>
      org.apache.shale.tiles.TilesViewHandler
    </view-handler>
  </application>

----
Dick


-----Original Message-----
From:   Dick Starr
Sent:   Wed 10/18/2006 2:52 PM
To:     user@shale.apache.org
Cc:     
Subject:        RE: new to shale tiles




-----Original Message-----
From:   Jonathan Smith [mailto:[EMAIL PROTECTED]
Sent:   Wed 10/18/2006 7:42 AM
To:     user@shale.apache.org
Cc:     
Subject:        new to shale tiles

is there a good example of how to implement tiles in shale and all the steps 
neccessary to do so?

_________________________________________________________________
Stay in touch with old friends and meet new ones with Windows Live Spaces 
http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us

Jonathan:

Not that I was able to find. Further, most web information refers to Struts 
Tiles, which will lead you astray. However, I and other posters are using 
stand-alone Tiles successfully.

I'll assume you have some experience with Struts Tiles. Here is what I did to 
get stand-alone Tiles working with Shale:

(1) Get on the latest Shale release (very important). I am using the 10/4/06 
release. You will need the shale-tiles and the tiles-core jars from the Shale 
release.

(2) In your web.xml create the following:

<!-- Tiles -->
  <context-param>
    <param-name>definitions-config</param-name>
    <param-value>/WEB-INF/conf/tiles.xml</param-value>
  </context-param>
  <listener>
    <listener-class>
      org.apache.tiles.listener.TilesListener
    </listener-class>
  </listener>

(3) Setup your tiles definitions. Here are some samples from my tiles.xml:

<!-- Site master definition -->
  <definition name="/siteMainLayout"
    path="/tiles/layouts/starraLayout.jsp">
      <put name="title" value="/tiles/common/title.jsp"/>
      <put name="header" value="/tiles/common/header.jsp"/>
      <put name="menuBar" value="/tiles/common/menuBar.jsp"/>
      <put name="body" value=""/>
      <put name="footer" value="/tiles/common/footer.jsp"/>
  </definition>
  
  <!-- System -->  
  <definition name="/systemLogoff"
    extends="/siteMainLayout">
      <put name="body"
        type="template"
        value="/jsp/system/logoff.jsp"/>
  </definition>
  
  <definition name="/systemLogon"
    extends="/siteMainLayout">
      <put name="body"
        type="template"
        value="/jsp/system/logon.jsp"/>
  </definition>

This is my title.jsp, used in /siteMainLayout

<%-- title.jsp
  2006-09-12 RJS. New.
--%>
<%@ include file="/jspf/common/taglibs.jspf" %>
<%@ include file="/jspf/common/messages.jspf" %>

<h:panelGroup>
  <h:outputText value="#{msg['app.title']}"/>
</h:panelGroup>

(4) Have your navigation rules point to your tiles, like so:

 <navigation-rule>
    <from-view-id>/systemLogoff.jsp</from-view-id>
    <navigation-case>
      <from-outcome>cancel</from-outcome>
      <to-view-id>/menuHome</to-view-id>
    </navigation-case>
    <navigation-case>
      <from-outcome>success</from-outcome>
      <to-view-id>/systemLogon</to-view-id>
    </navigation-case>
  </navigation-rule>
  
  <navigation-rule>
    <from-view-id>/systemLogon.jsp</from-view-id>
    <navigation-case>
      <from-outcome>success</from-outcome>
      <to-view-id>/menuHome</to-view-id>
    </navigation-case>
  </navigation-rule>

(5) Make your index.jsp forward to a tile like so:

<jsp:forward page="systemLogon.faces"/>

(6) The tiles definitions body templates refer to jsp's that only contain Shale 
components.

----
Dick  


Reply via email to