I have been trying to get the Shale Tiles extension inside my myfaces
application and have not had any luck.  There are a lot of conflicting
examples on the web and the page on the Shale site is blank.  I have the
following configuration but when I navigate to my page it merely
forwards to the standard JSP page rather than running it through the
tiles processor.  Can anyone point me to an example or tell me where I
have gone astray?  There are a number of examples that show using a
servlet in addition and other combinations.  If you can point me to a
sample application that would be good as well.

 

faces-config.xml

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer
Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd";>

<faces-config>

    <application>

        <message-bundle>messages</message-bundle>

        <locale-config>

            <default-locale>en_US</default-locale>

        </locale-config>

    </application>

    <application>

        <variable-resolver>

 
org.springframework.web.jsf.WebApplicationContextVariableResolver

        </variable-resolver>

    </application>

    <!-- Tiles Integration -->

    <application>

        <view-handler>

            org.apache.shale.tiles.TilesViewHandler

        </view-handler>

    </application>

 

<!--  Navigation Rules -->

    <navigation-rule>

        <navigation-case>

            <from-outcome>LoginView</from-outcome>

            <to-view-id>/JSP/LoginView.jsp</to-view-id>

        </navigation-case>

        <navigation-case>

            <from-outcome>LogoutView</from-outcome>

            <to-view-id>/JSP/LogoutView.jsp</to-view-id>

            <redirect />

        </navigation-case>

        <navigation-case>

            <from-outcome>HomeView</from-outcome>

            <to-view-id>/JSP/HomeView.jsp</to-view-id>

            <redirect />

        </navigation-case>

    </navigation-rule>

</faces-config>

 

 

Web.xml

 

<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee";

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";

    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";

    version="2.4">

    <context-param>

        <param-name>javax.faces.CONFIG_FILES</param-name>

        <param-value>/WEB-INF/faces-config.xml</param-value>

    </context-param>

    <!-- Tiles -->

    <context-param>

        <param-name>definitions-config</param-name>

        <param-value>/WEB-INF/tiles-defs.xml</param-value>

    </context-param>

    <listener>

        <listener-class>

            org.apache.tiles.listener.TilesListener

        </listener-class>

    </listener>

    <!-- Faces Servlet -->

        <servlet>

  <             <servlet-name>Faces Servlet</servlet-name> 

  <
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class> 

  <             <load-on-startup>1</load-on-startup> 

         </servlet>

    <!-- Extension mapping -->

    <servlet-mapping>

        <servlet-name>Faces Servlet</servlet-name>

        <url-pattern>*.faces</url-pattern>

    </servlet-mapping>

 

 

Tiles-defs.xml

 

<tiles-definition>

    <tiles-definitions>

        <definition name="master.template"

            path="/templates/layout.jsp">

            <put name="header" value="/common/header.jsp" />

            <put name="menu" value="/common/navigation.jsp" />

        </definition>

        <!-- Tiles Page -->

        <definition name="/JSP/HomeView"

            extends="master.template">

            <put name="body" value="/JSP/HomeView.jsp" />

        </definition>

        <definition name="/JSP/LoginView"

            extends="master.template">

            <put name="body" value="/JSP/LoginView.jsp" />

        </definition>

        <!-- Non Tiles Page -->

        <!-- 

            <definition name="/JSP/LoginView"

            path="/JSP/LoginView.jsp" />

        -->

        <definition name="/JSP/Error" path="/JSP/Error.jsp" />

    </tiles-definitions>

</tiles-definition>

 

Thanks

 

Scott Ryan

Consultant

303 768-4051

 


------------------------------------------------------------------------------
This e-mail transmission may contain information that is proprietary, 
privileged and/or confidential and is intended exclusively for the person(s) to 
whom it is addressed. Any use, copying, retention or disclosure by any person 
other than the intended recipient or the intended recipient's designees is 
strictly prohibited. If you are not the intended recipient or their designee, 
please notify the sender immediately by return e-mail and delete all copies. 
OppenheimerFunds may, at its sole discretion, monitor, review, retain and/or 
disclose the content of all email communications. 
==============================================================================

Reply via email to