Results 1 to 2 of 2

Thread: Spring 2.5 MultiActionController methodNameResolver not working

  1. #1

    Post Spring 2.5 MultiActionController methodNameResolver not working

    HI All,

    I am using a MultiActionControllerwith ParameterMethodNameResolver. I am getting error saying
    [PageNotFound] No request handling method with name 'myMethod' in class [com.domain.MyController]
    Below is my application-servlet.xml
    Code:
    <bean name="myController" class="com.domain.MyController">
        <property name="methodNameResolver" ref="paramResolver"></property>
    </bean>
    
      <bean name="paramResolver" class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver">
      	<property name="defaultMethodName" value="myMethod"></property>
        <property name="paramName" value="action"></property>
    </bean>

    Below is my Controller class:
    Code:
    public class MyController extends MultiActionController {
    	public ModelAndView myMethod(HttpServletRequest request, HttpServletRequest response)
    	throws Exception {
    	    System.out.println("In MyController .myMethod()...");
    	    
    	    return new ModelAndView("sampleView");
    	}
    
    /* Other action methods here */
    }

    Can someone please tell me what I am missing ??

  2. #2
    Join Date
    Jul 2010
    Posts
    1

    Default Change the second parameter of method

    The second parameter of the myMethod should be HttpServletResponse instead of HttpServletRequest. That is the reasond the method couldn't resolved.

Posting Permissions

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