Announcement Announcement Module
Collapse
No announcement yet.
Webflow, can't map a flow... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Webflow, can't map a flow...

    Hello,

    As a newbie i tried to code a simple webflow implementation.
    I based my learning on the hotel booking exemple, wich i guessed overkill in my case. Maybe, while trying to simplify it, i missed an important parameter.

    Here's my code :

    /WEB-INF/context-webflow.xml
    Code:
    	<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
        	<property name="flowExecutor" ref="flowExecutor" />
    	</bean>
    	
    	<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
       		<property name="flowRegistry" ref="flowRegistry"/>
      		<property name="order" value="-1"/>
    	</bean>
    	
    	<flow:flow-registry id="flowRegistry" base-path="/WEB-INF/flows">
        		<flow:flow-location-pattern value="/*/*.xml" />
    	</flow:flow-registry>
    	
    	<flow:flow-executor id="flowExecutor" />

    /WEB-INF/flows/register/register.xml
    Code:
    	<on-start>
    		<evaluate expression="UserService.startRegistration()" result="flowScope.user" />
    	</on-start>
    	
    	<view-state id="registerAccount" model="user">
        	<transition on="next" to="registerProfile" />
    	</view-state>
    	
    	<view-state id="registerProfile" model="user">
            <transition on="next" to="registerPicture" />
            <transition on="revise" to="registerAccount" />
            <transition on="cancel" to="registerCancel" />
        </view-state>
        
        <view-state id="registerPicture" model="user">
            <transition on="next" to="registerSuccess">
            	<evaluate expression="UserService.doRegistration(user)" />
            </transition>
            <transition on="revise" to="registrationProfile" />
            <transition on="cancel" to="registerCancel" />
        </view-state>
    	
    	<end-state id="registerCancel" />
    	<end-state id="registerSuccess" />
    When i launch my application, with logging at debug level i got this

    Code:
    DEBUG: org.springframework.core.io.support.PathMatchingResourcePatternResolver - Resolved location pattern [/WEB-INF/flows/*/*.xml] to resources [ServletContext resource [/WEB-INF/flows/register/register.xml]]
    DEBUG: org.springframework.webflow.definition.registry.FlowDefinitionRegistryImpl - Registering flow definition 'ServletContext resource [/WEB-INF/flows/register/register.xml]' under id 'register'
    DEBUG: org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'flowRegistry'
    Confirming the flow xml configuration was resolved, and the flow correctly registered.

    When i try to reach http://localhost:8080/myapp/register/registerAccount, the console return me this :

    Code:
    DEBUG: org.springframework.webflow.mvc.servlet.FlowHandlerMapping - No flow mapping found for request with URI '/myapp/register/registerAccount'
    When i try to reach http://localhost:8080/myapp/register/, the console return me this :

    Code:
    DEBUG: org.springframework.webflow.mvc.servlet.FlowHandlerMapping - No flow mapping found for request with URI '/myapp/register/'
    I really missed something in the mapping.
    Thanks for any help.
    Last edited by jun.in.mess; Feb 15th, 2013, 10:05 AM.

  • #2
    Stupid error solved :

    This line was'nt working:

    Code:
    <flow:flow-registry id="flowRegistry" base-path="/WEB-INF/flows">
        		<flow:flow-location-pattern value="/*/*.xml" />
    	</flow:flow-registry>
    Corrected to be :

    Code:
    <flow:flow-registry id="flowRegistry" base-path="/WEB-INF/flows">
        		<flow:flow-location-pattern value="/**/*.xml" />
    	</flow:flow-registry>
    Yup... Just one character...

    Comment

    Working...
    X