Announcement Announcement Module
Collapse
No announcement yet.
Rich Faces integration problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rich Faces integration problem

    Hi,

    I want to include RichFaces in my Spring Web Flow project. I followed the documentation and added:

    Code:
     <filter> 
            <display-name>RichFaces Filter</display-name> 
            <filter-name>richfaces</filter-name> 
            <filter-class>org.ajax4jsf.Filter</filter-class> 
        </filter> 
    
        <filter-mapping> 
            <filter-name>richfaces</filter-name> 
            <servlet-name>Faces Servlet</servlet-name>
            <dispatcher>REQUEST</dispatcher>
            <dispatcher>FORWARD</dispatcher>
            <dispatcher>INCLUDE</dispatcher>
        </filter-mapping>
    to my web.xml. Also included the libaries. While starting the Tomcat server I get the following error:

    Code:
    SCHWERWIEGEND: Exception starting filter richfaces
    java.lang.IllegalStateException: Filter mapping for chameleon filter richfaces do not contain wilcard prefix or suffix
    	at org.ajax4jsf.webapp.WebXml.setFilterName(WebXml.java:432)
    	at org.ajax4jsf.webapp.WebXml.init(WebXml.java:182)
    Any help?

    Regards

    Flashrider

  • #2
    I'm successfully using RichFaces 3.2.0SR1 with SWF CI-499.

    Below my web.xml evtl. you can figure out what is missing on your side:

    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <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">
    
    	<session-config>
    		<session-timeout>10</session-timeout>
    	</session-config>
    	
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>
    			/WEB-INF/web-application-config.xml
    		</param-value>
    	</context-param>
    	
    	<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>	
    		
    	<!-- Use JSF view templates saved as *.xhtml, for use with Facelets -->
    	<context-param>
    		<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    		<param-value>.xhtml</param-value>
    	</context-param>
    	
    	<!-- Enables special Facelets debug output during development -->
      	<context-param>
            <param-name>facelets.DEVELOPMENT</param-name>
       		<param-value>true</param-value>
      	</context-param>
      	  	
      	<!-- Causes Facelets to refresh templates during development -->
      	<context-param>
      		<param-name>facelets.REFRESH_PERIOD</param-name>
      		<param-value>1</param-value>
      	</context-param>
    
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
      	
      	<!-- Serves static resource content from .jar files such as spring-faces.jar -->
    	<servlet>
    		<servlet-name>Resources Servlet</servlet-name>
    		<servlet-class>org.springframework.js.resource.ResourceServlet</servlet-class>
    		<load-on-startup>0</load-on-startup>
    	</servlet>
    		
    	<!-- Map all /resources requests to the Resource Servlet for handling -->
    	<servlet-mapping>
    		<servlet-name>Resources Servlet</servlet-name>
    		<url-pattern>/resources/*</url-pattern>
    	</servlet-mapping>
    	
    	<!-- The front controller of this Spring Web application, responsible for handling all application requests -->
    	<servlet>
    		<servlet-name>Spring Web MVC Dispatcher Servlet</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<init-param>
    			<param-name>contextConfigLocation</param-name>
    			<param-value>
    				/WEB-INF/web-application-config.xml
    			</param-value>
    		</init-param>
    		<load-on-startup>2</load-on-startup>
    	</servlet>
    		
    	<!-- Map all /spring requests to the Dispatcher Servlet for handling -->
    	<servlet-mapping>
    		<servlet-name>Spring Web MVC Dispatcher Servlet</servlet-name>
    		<url-pattern>/metadata/*</url-pattern>
    	</servlet-mapping>
    
    	<!-- Just here so the JSF implementation can initialize, *not* used at runtime -->
    	<servlet>
    		<servlet-name>Faces Servlet</servlet-name>
    		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    		<load-on-startup>1</load-on-startup>
    	</servlet>
    	
    	<!-- Just here so the JSF implementation can initialize -->
    	<servlet-mapping>
    		<servlet-name>Faces Servlet</servlet-name>
    		<url-pattern>*.jsf</url-pattern>
    	</servlet-mapping>
    
    	<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>
                    <description>Set the size limit for uploaded files.
                           Format: 10 - 10 bytes
                          10k - 10 KB
                          10m - 10 MB
                          1g - 1 GB
                    </description>
                    <param-name>uploadMaxFileSize</param-name>
                    <param-value>10m</param-value>
            </init-param>
            <init-param>
                    <description>Set the threshold size - files below this limit are stored
    			     in memory, files above this limit are stored on disk.
                             Format: 10 - 10 bytes
                             10k - 10 KB
                             10m - 10 MB
                             1g - 1 GB
                     </description>
                     <param-name>uploadThresholdSize</param-name>
                     <param-value>100k</param-value>
             </init-param>
    	</filter>
    	
    	<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>
    	
    	<filter-mapping>
    		<filter-name>MyFacesExtensionsFilter</filter-name>
    		<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
    	</filter-mapping>
    
    	<filter-mapping>
    		<filter-name>MyFacesExtensionsFilter</filter-name>
    		<servlet-name>Spring Web MVC Dispatcher Servlet</servlet-name>
    	</filter-mapping>
    
    	 <filter>
            <filter-name>springSecurityFilterChain</filter-name>
            <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
        </filter>
    
        <filter-mapping>
          <filter-name>springSecurityFilterChain</filter-name>
          <url-pattern>/*</url-pattern>
        </filter-mapping>
      	
    	<welcome-file-list>
    		<welcome-file>index.html</welcome-file>
    	</welcome-file-list>
    
    </web-app>
    - Peter

    Comment


    • #3
      I find the solution. It was my fault. I wrote "Spring Dispatcher Servlet" instead of "Spring MVC Dispatcher Servlet" which is the name of the servlet. :-)

      Comment

      Working...
      X