5 Replies Latest reply on Jul 17, 2007 2:26 PM by Rick Hightower

    Tomahawk and RichFaces not playing nice

    Rick Hightower Newbie

      I can't seem to get Tomahawk and RichFaces working in the same app. I tried switching the order of the filters but I alway get the same result.

      The reason I want Tomahawk is that I need a caledar widget and RichFaces does not have one built in.

      Tomahawk throws an exception with the following pertinent information:

      ExtensionsFilter not correctly configured. Resource mapping missing. Resources cant be delivered. Please see: http://myfaces.apache.org/tomahawk/extensionsFilter.html
      





        • 1. Re: Tomahawk and RichFaces not playing nice
          Jason Long Master

          I have it working in my app. I was always using Tomahawk, but I am trying to phase it out. I have the tomahawk libs in jsf-libs for tomcat in JBoss 4.2, but this also worked in 4.0.4 and MyFaces

          Here is a copy of my web.xml

          <?xml version="1.0" encoding="UTF-8"?>
          <web-app version="2.5"
           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/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
          
           <!-- Ajax4jsf (must come first!) -->
           <filter>
           <display-name>Ajax4jsf Filter</display-name>
           <filter-name>ajax4jsf</filter-name>
           <filter-class>org.ajax4jsf.Filter</filter-class>
           </filter>
           <filter-mapping>
           <filter-name>ajax4jsf</filter-name>
           <url-pattern>*.xhtml</url-pattern>
           </filter-mapping>
           <context-param>
           <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
           <param-value>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</param-value>
           </context-param>
          
           <!-- Seam -->
           <listener>
           <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
           </listener>
          
           <filter>
           <filter-name>Seam Filter</filter-name>
           <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
           </filter>
          
           <filter-mapping>
           <filter-name>Seam Filter</filter-name>
           <url-pattern>/*</url-pattern>
           </filter-mapping>
          
           <servlet>
           <servlet-name>Seam Resource Servlet</servlet-name>
           <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
           </servlet>
          
           <servlet-mapping>
           <servlet-name>Seam Resource Servlet</servlet-name>
           <url-pattern>/seam/resource/*</url-pattern>
           </servlet-mapping>
          
           <!-- Tomahawk -->
           <filter>
           <filter-name>MyFacesExtensionsFilter</filter-name>
           <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
           </filter>
           <filter-mapping>
           <filter-name>MyFacesExtensionsFilter</filter-name>
           <servlet-name>Faces Servlet</servlet-name>
           </filter-mapping>
           <filter-mapping>
           <filter-name>MyFacesExtensionsFilter</filter-name>
           <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
           </filter-mapping>
          
           <!-- JSF and Facelets -->
           <context-param>
           <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
           <param-value>server</param-value>
           </context-param>
           <context-param>
           <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
           <param-value>.xhtml</param-value>
           </context-param>
           <context-param>
           <param-name>facelets.DEVELOPMENT</param-name>
           <param-value>true</param-value>
           </context-param>
           <context-param>
           <param-name>facelets.LIBRARIES</param-name>
           <param-value>/WEB-INF/tomahawk.taglib.xml/<param-value>
           </context-param>
           <context-param>
           <param-name>javax.faces.CONFIG_FILES</param-name>
           <param-value>/WEB-INF/navigation.xml</param-value>
           </context-param>
          
           <!-- 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>
           <servlet-mapping>
           <servlet-name>Faces Servlet</servlet-name>
           <url-pattern>*.xhtml</url-pattern>
           </servlet-mapping>
          
           <!-- JSF RI -->
           <listener>
           <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
           </listener>
          
           <!-- Welcome files -->
           <welcome-file-list>
           <welcome-file>index.xhtml</welcome-file>
           </welcome-file-list>
          
          </web-app>


          • 2. Re: Tomahawk and RichFaces not playing nice
            Rick Hightower Newbie

            I got it working with some help from Bill Dudney and some trial and error. I will post my working web.xml file for future google searches.

            • 3. Re: Tomahawk and RichFaces not playing nice
              Rick Hightower Newbie

              Hey Jason,

              Thanks. I got past my issue. Here is the web.xml that worked for me.

              <?xml version="1.0" encoding="UTF-8"?>
              <web-app version="2.4" 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">
               <display-name>VMC</display-name>
               <context-param>
               <param-name>contextConfigLocation</param-name>
               <param-value>/WEB-INF/applicationContext.xml</param-value>
               </context-param>
               <context-param>
               <param-name>facelets.LIBRARIES</param-name>
               <param-value>
               /WEB-INF/crank.taglib.xml;/WEB-INF/tomahawk.taglib.xml
               </param-value>
               </context-param>
               <context-param>
               <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
               <param-value>.xhtml</param-value>
               </context-param>
               <context-param>
               <param-name>facelets.REFRESH_PERIOD</param-name>
               <param-value>2</param-value>
               </context-param>
               <context-param>
               <param-name>facelets.DEVELOPMENT</param-name>
               <param-value>true</param-value>
               </context-param>
               <context-param>
               <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
               <param-value>server</param-value>
               </context-param>
               <context-param>
               <param-name>com.sun.faces.validateXml</param-name>
               <param-value>true</param-value>
               </context-param>
               <context-param>
               <param-name>com.sun.faces.verifyObjects</param-name>
               <param-value>true</param-value>
               </context-param>
               <context-param>
               <param-name>org.ajax4jsf.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>
               <context-param>
               <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
               <param-value>false</param-value>
               </context-param>
               <context-param>
               <param-name>javax.faces.CONFIG_FILES</param-name>
               <param-value>/WEB-INF/faces-config.xml</param-value>
               </context-param>
               <listener>
               <listener-class>
               org.springframework.web.context.ContextLoaderListener
               </listener-class>
               </listener>
               <listener>
               <listener-class>
               org.springframework.web.context.request.RequestContextListener
               </listener-class>
               </listener>
              
               <!--
               -->
               <filter>
               <display-name>Ajax4jsf Filter</display-name>
               <filter-name>ajax4jsf</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>20m</param-value>
               </init-param>
               </filter>
              
               <filter-mapping>
               <filter-name>ajax4jsf</filter-name>
               <servlet-name>Faces Servlet</servlet-name>
               <dispatcher>REQUEST</dispatcher>
               <dispatcher>FORWARD</dispatcher>
               <dispatcher>INCLUDE</dispatcher>
               </filter-mapping>
               <filter-mapping>
               <filter-name>MyFacesExtensionsFilter</filter-name>
               <servlet-name>Faces Servlet</servlet-name>
               <dispatcher>REQUEST</dispatcher>
               <dispatcher>FORWARD</dispatcher>
               <dispatcher>INCLUDE</dispatcher>
               </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>
              
               <servlet>
               <servlet-name>Faces Servlet</servlet-name>
               <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
               <load-on-startup>1</load-on-startup>
               </servlet>
               <servlet-mapping>
               <servlet-name>Faces Servlet</servlet-name>
               <url-pattern>/faces/*</url-pattern>
               </servlet-mapping>
               <servlet-mapping>
               <servlet-name>Faces Servlet</servlet-name>
               <url-pattern>*.jsf</url-pattern>
               </servlet-mapping>
               <login-config>
               <auth-method>BASIC</auth-method>
               </login-config>
              </web-app>
              
              
              


              For me... It would not work until I added the dispatcher bit (I am using Jetty maven plugin).

              <filter-mapping>
              <filter-name>MyFacesExtensionsFilter</filter-name>
              <servlet-name>Faces Servlet</servlet-name>
              REQUEST
              FORWARD
              INCLUDE
              </filter-mapping>

              Now I am past the last issue but the calendar only works if I don't have it popup. The popup version of the calendar does not work. I am going to debug it.

              • 4. Re: Tomahawk and RichFaces not playing nice
                Rick Hightower Newbie

                Oh what fun!

                I fired up FireFox to debug the t:calendar not working, and it worked.

                It just does not work in IE, and no I can't not support IE.

                It does render but it is off the page (down and to the right). You can scroll there and find it.

                I read once somewhere that someone was having problems using richfaces Tabs and some other component framework. I am going to remove tabs and see if the issue goes away.

                Jason and Bill. thanks for your help.

                • 5. Re: Tomahawk and RichFaces not playing nice
                  Rick Hightower Newbie

                  I got rid of the rich faces tab support and the Tomahawk component works in IE.