Announcement Announcement Module
Collapse
No announcement yet.
Spring MVC with Web-Flow results in error No Mapping found with URI Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring MVC with Web-Flow results in error No Mapping found with URI

    Hi,

    When I submit a request to my @Controller annotated controller I get following error: No mapping found for HTTP request with URI [/SpringRequest/spring/welcome]

    Here is the log:
    Code:
    org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/spring/**] onto handler [frb.trf.web.controller.HomeController@738a738a]
    org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/spring/**.*] onto handler [frb.trf.web.controller.HomeController@738a738a]
    
    
    
    org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'spring' determining Last-Modified value for [/SpringRequest/spring/welcome]
    org.springframework.webflow.mvc.servlet.FlowHandlerMapping - No flow mapping found for request with URI '/springRequestWeb/spring/welcome'
    org.springframework.web.servlet.DispatcherServlet - No handler found in getLastModified
    org.springframework.web.servlet.DispatcherServlet - DispatcherServlet with name 'spring' processing request for [/SpringRequest/spring/welcome]
    org.springframework.webflow.mvc.servlet.FlowHandlerMapping - No flow mapping found for request with URI '/SpringRequest/spring/welcome'
    org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/SpringRequest/spring/welcome] in DispatcherServlet with name 'spring'
    org.springframework.web.servlet.DispatcherServlet - Successfully completed request
    Dispatcher is configured as follows:
    Code:
        <!-- Handles Spring requests -->
        <servlet>
            <servlet-name>spring</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <init-param>
                <param-name>contextConfigLocation</param-name>
                <param-value>/WEB-INF/spring/applicationContext.xml</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>
    
    	<servlet-mapping>
    		<servlet-name>spring</servlet-name>
    		<url-pattern>/spring/*</url-pattern>
    	</servlet-mapping>

    My webflow configuration is as follows:
    Code:
    	<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
    	    <property name="flowRegistry" ref="flowRegistry"/>
    	    <property name="order" value="0"/>
    	</bean>
    
    	<webflow:flow-registry id="flowRegistry">
    		<webflow:flow-location id="requestFlow" path="/WEB-INF/flows/request-flow.xml" />
    	</webflow:flow-registry>
    	
    	<webflow:flow-executor id="flowExecutor" />

    And the controller is defined as
    Code:
    @Controller
    @RequestMapping(value="/travel/**")
    public class HomeController {
    
    	@RequestMapping(value = "welcome", method = RequestMethod.GET)
    		public String welcome(){
    			//;;;;;;;;;;;;
    		}

    Please suggest what is wrong here?

  • #2
    Removing the flow handler mapping lets my controller handle the request. However, how do I let web flow handle requests which are part of a flow?

    Code:
    	<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
    	    <property name="flowRegistry" ref="flowRegistry"/>
    	    <property name="order" value="0"/>
    	</bean>

    Comment


    • #3
      Finally, I figured it out and here it is for someone who is trying the same!

      When integrating Spring Web Flow with your Spring MVC application, annotated controllers will work fine except REST based URL's defined on them won't.

      To make annotated controllers work you will have to define SimpleUrlHandlerMapping.

      I believe this should have been documented in Web Flow Reference because issue is encountered only when Web Flow integration is done with MVC.

      Comment


      • #4
        Thanks for taking the time to document this. I, too, am running into an issue where anything mapped to my controller is being disregarded as soon as I import my FlowHandlerMapping XML configuration. This is definitely frustrating. I attempted to map the controller via a simple URL handler mapping, but that didn't seem to work. I'll keep digging.

        I just don't get why the FlowHandlerMapping seems to interfere with the controller request mappings.

        Comment

        Working...
        X