Announcement Announcement Module
Collapse
No announcement yet.
WebFlow & RichFaces --> Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • WebFlow & RichFaces -->

    Hi togehter,
    I'm trying to use the following technologies:
    Spring 2.5.6, WebFlow 2.0.5GA and RichFaces 3.3.0GA.

    With the simple RichFaces example I always get the following js-error
    Code:
    Error: A4J is not defined
    Source File: http://localhost:49212/hai-web/ec/catalog/risktype?execution=e1s1
    Line: 1
    I searched the web, but I can't find a way to solve my problem.
    Here is my web.xml:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    	id="WebApp_ID" version="2.5">
    	<display-name>hai-web</display-name>
    	<description>EnCo SafetyOffice Server - Hazard Analysis Module: Industries</description>
    
    	<!-- The master configuration file for this Spring web application -->
    	<context-param>
    		<param-name>contextConfigLocation</param-name>
    		<param-value>/WEB-INF/config/web-application-config.xml</param-value>
    	</context-param>
    
    	<!-- Plugging the "Blue Sky" skin into the project -->
    	<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>
    	<context-param>
    		<param-name>org.ajax4jsf.RESOURCE_URI_PREFIX</param-name>
    		<param-value>ec</param-value>
    	</context-param>
    	
    
    	<!-- Making the RichFaces skin spread to standard HTML controls -->
    	<context-param>
    		<param-name>org.richfaces.CONTROL_SKINNING</param-name>
    		<param-value>enable</param-value>
    	</context-param>
    
    	<!-- Defining and mapping the RichFaces filter -->
    	<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>
    
    
    	<!-- 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>
    
    
    	<!-- Enables Spring Security -->
    	<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>
    
    	<!-- Loads the Spring web application context -->
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    
    	<!--
    		The front controller of this Spring Web application, responsible for
    		handling all application requests
    	-->
    	<servlet>
    		<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<init-param>
    			<param-name>contextConfigLocation</param-name>
    			<param-value></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 MVC Dispatcher Servlet</servlet-name>
    		<url-pattern>/ec/*</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>*.faces</url-pattern>
    	</servlet-mapping>
    
    	<welcome-file-list>
    		<welcome-file>index.html</welcome-file>
    	</welcome-file-list>
    
    </web-app>
    and my webmvc-config.xml:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="
               http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
    
    	<!-- Maps request URIs to controllers -->			
    	<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    		<property name="mappings">
    			<value>
    				/main=flowController
    				/catalog/risktype=flowController
    			</value>
    		</property>
    		<property name="defaultHandler">
    			<!-- Selects view names to render based on the request URI: e.g. /main selects "main" -->	
    			<bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController" />
    		</property>
    	</bean>
    
    	<!-- Handles requests mapped to the Spring Web Flow system -->
    	<bean id="flowController" class="org.springframework.webflow.mvc.servlet.FlowController">
    		<property name="flowExecutor" ref="flowExecutor"/>
    		 <property name="ajaxHandler">
                <bean class="org.springframework.faces.richfaces.RichFacesAjaxHandler"/>
            </property>
    		
    	</bean>
    
    	<!-- Maps logical view names to Facelet templates (e.g. 'search' to '/WEB-INF/search.xhtml' -->
    	<bean id="faceletsViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
    		<property name="viewClass" value="org.springframework.faces.mvc.JsfView"/>
    		<property name="prefix" value="/WEB-INF/" />
    		<property name="suffix" value=".xhtml" />
    	</bean>
    		
    </beans>
    and my faces-config.xml
    Code:
    <?xml version="1.0"?>
    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
    
    <faces-config>
    </faces-config>
    Any idea?

  • #2
    Originally posted by fritzrichter View Post

    Any idea?
    Problem is here:

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

    Bind this filter to the spring servlet instead.

    Comment


    • #3
      Thanks, this was so easy

      Comment


      • #4
        richfaces and web flow

        Originally posted by Hedin View Post
        Problem is here:

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

        Bind this filter to the spring servlet instead.
        Thank you so much!!!!

        Comment


        • #5
          same problem

          Hi,

          could you please tell me (maybe with an example) how can I solve this problem? How can I bind with the Spring servlet? Would it be
          Code:
          org.springframework.web.servlet.DispatcherServlet
          ?

          If so, but if the rest of my servlet-mapping? Would I use jsf normally?

          Thanks

          Comment

          Working...
          X