Announcement Announcement Module
No announcement yet.
Spring Webflow and Spring MVC config issue Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Webflow and Spring MVC config issue

    I have been using webflow for a while and now want to add spring mvc to the mix. I can get to my flows, but I can't get to any of my annotated controllers. Here's how it is currently configured:

    	<bean id="flowController" class="org.springframework.webflow.mvc.servlet.FlowController">
    	    <property name="flowExecutor" ref="flowExecutor"/>
    	    <property name="flowHandlerAdapter" ref="customFlowHandlerAdapter" />
    	    <property name="flowUrlHandler">
    	        <bean class="org.springframework.webflow.context.servlet.WebFlow1FlowUrlHandler"/>
    	<bean id="customFlowHandlerAdapter" class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
    		<property name="flowExecutor" ref="flowExecutor"/>
    		<property name="flowExecutor.executionRepository.alwaysGenerateNewNextKey" value="false"/>
    	<bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter"/>
    	<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    		<property name="mappings">
    	   <property name="order" value="0" />
    	<!-- Maps requests to @Controllers based on @RequestMapping("path") annotation values
    		 If no annotation-based path mapping is found, Spring MVC proceeds to the next HandlerMapping (order=2 below). -->
    	<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
    		<property name="order" value="1" />
    	<!-- Maps requests to @Controllers based on controller class name convention; e.g. a request for /hotels or a /hotels sub-resource maps to HotelsController
    	     If no class mapping is found, Spring MVC sends a 404 response and logs a pageNotFound warning. -->
    	<bean class="">
    		<property name="order" value="2" />
    	<!-- Enables annotated @Controllers; responsible for invoking an annotated POJO @Controller when one is mapped. -->
    	<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
        <context:component-scan base-package="com.xactsites.xacttotal.valuation.web" />
    Here's my controller:

    public class MmNadaController
    	public MmNadaController()
    	@RequestMapping(value="/", method = RequestMethod.GET)
    	public void defaultPage()       
    My web.xml servlet mapping looks like this:
    When I go to the following url on my machine: http://localhost:8080/apps/iv/iv.xva...Id=mytest-flow it works great. However if I try to go to this url: http://localhost:8080/apps/iv/mmNada.test it doesn't get to my Log.trace("test");. It gets a 404 error, I even tried going to http://localhost:8080/apps/iv/mmNada/ to see if it would pick up the controller class name. I am guessing this is just a simple setup issue, but I can't seem to figure this out. Any direction would be greatly appreciatted. Thanks.

  • #2
    Ok, I spent hours trying to figure this out before posting it and now, soon after I do I found out what was going on. My web.xml was only looking for the pattern *.xval, thus excluding my controllers from getting called because the request wasn't routed through the dispatchServlet.