Results 1 to 2 of 2

Thread: Flex client with Spring MVC

  1. #1

    Default Flex client with Spring MVC

    I have tried to configure my flex and spring mvc based on the documentation here http://static.springsource.org/sprin...and-spring-mvc
    I am keeping things consolidated under single Dispatcher Servlet hence using
    Code:
    <servlet>
        <servlet-name>spring-mvc</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    
    <servlet-mapping>
        <servlet-name>spring-mvc</servlet-name>
        <url-pattern>/spring/*</url-pattern>
    </servlet-mapping>
    Code:
    <flex:message-broker>
        <flex:mapping pattern="/messagebroker/*" />
    </flex:message-broker>
    For my mvc controllers I am using the annotated configuration with context component scan
    Code:
    <beans>
    <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
    <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>
    <context:component-scan base-package="com.mypackage"/>
    </beans>
    and my controller

    Code:
    @Controller
    public class ConfirmController {
    	
    	@RequestMapping("/confirm.htm")
    	public void confirm(){
    		System.out.println("hello");
    	}
    }
    The code works fine but I do get one problem when I configure it in the above fashion.
    When I hit the link http://localhost/spring/confirm.htm

    This is what I get on console
    Code:
    hello
    01 Sep 2010 13:44:53 WARN  [http-80-2]: org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/spring/confirm] in DispatcherServlet with name 'spring'
    Due to keeping things under one dispatcher servlet I have to use servlet-mapping of /spring/*. The first line is the expected output. What should I do about the warning?

  2. #2
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    The error is a bit misleading, but the problem is that you're not actually generating any sort of response, either by resolution of an MVC View or by using @ResponseBody.

    BTW, with Spring 3.0, you shouldn't need to manually configure DefaultAnnotationHandlerMapping and AnnotationMethodHandlerAdapter anymore. You can just use "mvc:annotation-driven" instead. See:
    http://static.springsource.org/sprin...tml#mvc-config
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •