Announcement Announcement Module
Collapse
No announcement yet.
Empty flowRenderFragments on converter errors Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Empty flowRenderFragments on converter errors

    Hi everyone!

    My problem is so basic, that I think it must be my fault. However, I did find a solution for a day now and searching in my thinking of intuition does not get me any further.

    So: We are using Spring Webflow (2.0.7) with Richfaces (3.3.0). We got a site where the user can enter a id and the action searches for the account with the given id. Everything fine so far. Now - the id is an java.lang.Integer, we defined a converterMessage and it is shown if the user enters a string. Again - everything fine. But now I switch to an a4j:commandButton and - well, everything works fine as long as i enter integers. The search and the display of the result works, even the message that an account with the id could not be found works. But if I enter a string and the converter failed to write the value into the model, then flowRenderFragments is empty and nothing will be rerendered, especially not the messages.
    I cannot believe that there is no solution for that!? What do I have to do to register "default-rerender-ids" or change the behavior to automatically rerender h:messages!?

    xhtml:
    Code:
    <ui:define name="center">		
    	<a4j:form>
    		<rich:panel>
    			<f:facet name="header">
    				<h:outputText value="#{msg['account.search']}" />
    			</f:facet>
    			<h:panelGrid columns="2">
    				<h:panelGroup layout="block">
    					<h:outputText value="#{msg['account.id']}" />
    				</h:panelGroup>
    				<h:panelGroup>
    					<h:inputText value="#{accountDraft.id}" required="true" requiredMessage="#{msg['errors.required']}" converterMessage="#{msg['errors.integer']}" />
    				</h:panelGroup>
    				<a4j:commandButton action="search" value="#{msg['account.search']}" reRender="#{flowRenderFragments}"/>
    				<a4j:outputPanel id="messages">
    					<h:messages errorClass="errors" />
    				</a4j:outputPanel>
    			</h:panelGrid>
    		</rich:panel>
    	</a4j:form>
    </ui:define>
    web.xml:
    Code:
    <listener>
    	<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>
    	
    <!-- Filters -->
    <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>Spring MVC Dispatcher Servlet</servlet-name>
    	<dispatcher>REQUEST</dispatcher>
    	<dispatcher>FORWARD</dispatcher>
    	<dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <filter-mapping>
    	<filter-name>richfaces</filter-name>
    	<servlet-name>Faces Servlet</servlet-name>
    	<dispatcher>REQUEST</dispatcher>
    	<dispatcher>FORWARD</dispatcher>
    	<dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    
    <!-- Spring Security Filter -->
    <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>
    	<dispatcher>REQUEST</dispatcher>
    	<dispatcher>FORWARD</dispatcher>
    </filter-mapping>
    
    <!-- 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>/spring/*</url-pattern>
    </servlet-mapping>
    
    <!-- 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>
    
    <!-- Faces Servlet Mapping -->
    <servlet-mapping>
    	<servlet-name>Faces Servlet</servlet-name>
    	<url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    faces-config:
    Code:
    <faces-config 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-facesconfig_1_2.xsd"
    	version="1.2">
    
    	<!-- from project setup -->
    	<application>
    		<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
    		<el-resolver>
    			org.springframework.web.jsf.el.SpringBeanFacesELResolver
    		</el-resolver>
    		<!-- Should be configured thru Spring messageSource Bean -->
    		<locale-config>
    			<default-locale>de</default-locale>
    			<supported-locale>de</supported-locale>
    			<supported-locale>en</supported-locale>
    		</locale-config>
    		<message-bundle>ApplicationResources</message-bundle>
    		<resource-bundle>
    			<base-name>ApplicationResources</base-name>
    			<var>msg</var>
    		</resource-bundle>
    	</application>
    
    </faces-config>

  • #2
    did you ever manage to fix this ?

    Comment


    • #3
      Hi Paul,

      well, finally we had to implement our own validators anyway, so we worked around this problem.

      I will find out if someone else in our team did solve the problem and if so, I will post an answer until the end of the week.

      Greetings

      Comment

      Working...
      X