2 Replies Latest reply on Mar 9, 2010 3:41 AM by debashis Malo

    Need to integrate Spring webflow,jsf,richfaces,facelet..

    debashis Malo Newbie

      Hi,

      I'm currently using Spring webflow,jsf,richfaces,facelet.. I'm getting confused as to which configuration mapping is correct for integrating mentioned technologies to be used in a single application. Please help me.

       

       

      Following is the the entry in web.xml.

       

      Option 1

      ---------------

      <filter-mapping>
          <filter-name>richfaces</filter-name>
          <servlet-name>Spring Web MVC Dispatcher Servlet</servlet-name>
          <dispatcher>REQUEST</dispatcher>
          <dispatcher>FORWARD</dispatcher>
          <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>

       

      Option 2

      ---------------

      <filter-mapping>

        <filter-name>richfaces</filter-name>

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

        <dispatcher>REQUEST</dispatcher>

        <dispatcher>FORWARD</dispatcher>

        <dispatcher>INCLUDE</dispatcher>

      </filter-mapping>

       

       

      Regards,

      Debashis

        • 1. Re: Need to integrate Spring webflow,jsf,richfaces,facelet..
          Harut Sargsyan Apprentice

          Hello, here is the web.xml of one of my projects. It uses  Spring, jsf, richfaces, facelet, restfaces, Acegi... etc... Try to use, It works fine for me.

           

          <?xml version="1.0"?>

           

          <web-app xmlns="http://java.sun.com/xml/ns/javaee"
                   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
          http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                   version="2.5">

           

              <!-- Rhich Faces Configuration -->
              <context-param>
                  <param-name>org.richfaces.SKIN</param-name>
                  <param-value>blueSky</param-value>
              </context-param>

           

              <context-param>
                  <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                  <param-value>com.sun.facelets.FaceletViewHandler</param-value>
              </context-param>

           


              <!-- Spring Configuration -->
              <context-param>
                  <param-name>contextConfigLocation</param-name>
                  <param-value>/WEB-INF/classes/spring-*.xml</param-value>
              </context-param>

           

              <!-- Java Server Faces Configuration -->
              <context-param>
                  <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                  <param-value>server</param-value>
              </context-param>

           

              <context-param>
                  <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
                  <param-value>40</param-value>
                  <!--<description>Only applicable if state saving method is "server" (= default).
                           Defines the amount (default = 20) of the latest views are stored in session.
                 </description> -->
              </context-param>

           

              <context-param>
                  <param-name>javax.faces.CONFIG_FILES</param-name>
                  <param-value>/WEB-INF/faces-config.xml</param-value>
              </context-param>

           


              <!-- Facelets Configuration -->

           

              <!-- Use Documents Saved as *.xhtml -->
              <context-param>
                  <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                  <param-value>.xhtml</param-value>
              </context-param>

           

              <!-- Special Debug Output for Development -->
              <context-param>
                  <param-name>facelets.DEVELOPMENT</param-name>
                  <param-value>false</param-value>
              </context-param>

           

              <!-- Optional JSF-RI Parameters to Help Debug -->
              <context-param>
                  <param-name>com.sun.faces.validateXml</param-name>
                  <param-value>false</param-value>
              </context-param>
              <context-param>
                  <param-name>com.sun.faces.verifyObjects</param-name>
                  <param-value>false</param-value>
              </context-param>

           

              <!-- added to fix error 500 -->
              <context-param>
                  <param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
                  <param-value>false</param-value>
              </context-param>

           

              <context-param>
                  <param-name>org.restfaces.DEVELOPMENT</param-name>
                  <param-value>false</param-value>
              </context-param>

           

              <!-- Listeners  -->
              <listener>
                  <listener-class>
                      org.springframework.web.context.ContextLoaderListener
                  </listener-class>
              </listener>

           

              <listener>
                  <listener-class>
                      org.springframework.web.context.request.RequestContextListener
                  </listener-class>
              </listener>

           

              <!-- restfaces  -->
              <listener>
                  <listener-class>
                      com.sun.faces.config.ConfigureListener
                  </listener-class>
              </listener>
              <!-- ~restfaces -->

           


              <!-- Filters -->
              <filter>
                  <display-name>RichFaces Filter</display-name>
                  <filter-name>richfaces</filter-name>
                  <filter-class>org.ajax4jsf.Filter</filter-class>
              </filter>

           

              <filter>
                  <filter-name>MyFacesExtensionsFilter</filter-name>
                  <filter-class>
                      org.apache.myfaces.webapp.filter.ExtensionsFilter
                  </filter-class>
                  <init-param>
                      <param-name>maxFileSize</param-name>
                      <param-value>10m</param-value>
                  </init-param>
              </filter>

           

              <!-- The Acegi Chain Proxy Filter -->
              <filter>
                  <filter-name>Acegi Filter Chain Proxy</filter-name>
                  <filter-class>
                      org.acegisecurity.util.FilterToBeanProxy
                  </filter-class>
                  <init-param>
                      <param-name>targetClass</param-name>
                      <param-value>
                          org.acegisecurity.util.FilterChainProxy
                      </param-value>
                  </init-param>
              </filter>

           

              <!-- The Acegi Chain Proxy Filter-Mapping -->
              <filter-mapping>
                  <filter-name>Acegi Filter Chain Proxy</filter-name>
                  <url-pattern>/*</url-pattern>
              </filter-mapping>

           

              <!-- Filter Mappings -->
              <filter-mapping>
                  <filter-name>richfaces</filter-name>
                  <servlet-name>Faces Servlet</servlet-name>
                  <dispatcher>REQUEST</dispatcher>
                  <dispatcher>FORWARD</dispatcher>
                  <dispatcher>INCLUDE</dispatcher>
              </filter-mapping>

           


              <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages  -->
              <filter-mapping>
                  <filter-name>MyFacesExtensionsFilter</filter-name>
                  <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
                  <servlet-name>Faces Servlet</servlet-name>
              </filter-mapping>

           

              <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.)  -->
              <filter-mapping>
                  <filter-name>MyFacesExtensionsFilter</filter-name>
                  <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
              </filter-mapping>

           


              <filter-mapping>
                  <filter-name>MyFacesExtensionsFilter</filter-name>
                  <url-pattern>*.jsf</url-pattern>
              </filter-mapping>

           

              <!-- Faces Servlet -->
              <!-- The Original Serlet must be defined, to get the faces servlet initialized.
                   Otherwise an exception will be thrown on startup. No mapping needed for this servlet.
               -->
              <servlet>
                  <servlet-name>Original Servlet</servlet-name>
                  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                  <load-on-startup>1</load-on-startup>
              </servlet>

           

              <servlet>
                  <servlet-name>Faces Servlet</servlet-name>
                  <servlet-class>
                      de.virtualsolution.apps.onlinediscounting.faces.TvsFacesServlet
                  </servlet-class>
                  <init-param>
                      <param-name>errorPage</param-name>
                      <param-value>/pages/error.jsf</param-value>
                  </init-param>
                  <load-on-startup>2</load-on-startup>
              </servlet>
              <!-- ~Faces Servlet -->

           

              <!-- Faces Servlet Mapping -->
              <servlet-mapping>
                  <servlet-name>Faces Servlet</servlet-name>
                  <url-pattern>*.jsf</url-pattern>
              </servlet-mapping>

           


              <!-- restfaces -->
              <filter>
                  <filter-name>RestFaces Filter</filter-name>
                  <filter-class>org.restfaces.Filter</filter-class>
                  <init-param>
                      <param-name>faces-mapping</param-name>
                      <param-value>.jsf</param-value>
                  </init-param>
              </filter>

           

              <filter-mapping>
                  <filter-name>RestFaces Filter</filter-name>
                  <url-pattern>/*</url-pattern>
              </filter-mapping>

           

              <!-- ~restfaces -->

           

              <error-page>
                  <error-code>403</error-code>
                  <location>/pages/accessDenied.jsf</location>
              </error-page>
              <error-page>
                  <error-code>404</error-code>
                  <location>/pages/accessDenied.jsf</location>
              </error-page>
              <error-page>
                  <error-code>500</error-code>
                  <location>/pages/accessDenied.jsf</location>
              </error-page>
              <error-page>
                  <exception-type>javax.faces.application.ViewExpiredException</exception-type>
                  <location>/pages/accessDenied.jsf</location>
              </error-page>

           

          </web-app>

          • 2. Re: Need to integrate Spring webflow,jsf,richfaces,facelet..
            debashis Malo Newbie

            Thanks a lot. I'll try this.

             

            Regards,

            Debashis