0 Replies Latest reply on Sep 25, 2007 8:47 AM by Brian Santarelli

    Success with RichFaces and Tiles?

    Brian Santarelli Newbie

      I was wondering if anyone has successfully integrated RichFaces into a legacy Struts/Tiles app.

      I am able to set everything up and have RichFaces render the component tree as expected as a tile, but the URLs in the Ajax4JSF tags are rendered with a .jsp extension rather than a .faces extension, so none of the AJAX stuff works.

      I am wrapping the JSF page in a JSP where the JSF page URL is passed in as a parameter like so:

      <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
      <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
      
      <html>
       <body>
       <tiles:insert definition="mainLayout" flush="false">
       <tiles:put name="MainPage" value="<%=request.getParameter("url")%>"/>
       </tiles:insert>
       </body>
      </html>


      Here is the simple XHTML example that I am wrapping with the JSP above (extracted from the simple echo example):

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:rich="http://richfaces.org/rich"
       xmlns:a4j="http://richfaces.org/a4j"
       >
       <head>
       </head>
       <body>
       <a4j:form id="main">
       <rich:panel header="Simple Echo">
       <h:inputText size="50" value="${testBean2.text}">
       <a4j:support event="onkeyup" reRender="rep"/>
       </h:inputText>
       <h:outputText value="${testBean2.text}" id="rep"/>
       </rich:panel>
       </a4j:form>
       </body>
      
      </html>


      Also, is there a better approach?

      Thanks