spring mvc No matching handler method found for servlet request:

2018-09-09 14:31:39  [ http-apr-9004-exec-9:393161 ] - [ ERROR ] 
cn.com.biz.exception.MyExceptionHandler.resolveException(MyExceptionHandler.java:27) 
org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException: 
No matching handler method found for servlet request: 
path '/OrderController.do', method 'POST', parameters map['getProduct' -> array<String>[''], 'field' -> array<String>['id,matnr,maktx,'], 'page' -> array<String>['1'], 'rows' -> array<String>['20']]
    at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter$ServletHandlerMethodResolver.resolveHandlerMethod(AnnotationMethodHandlerAdapter.java:667)
    at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:431)
    at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)

 

 

最后发现 同一个类中映射了两个相同的路径

下面还有一个方法用了相同的params
@RequestMapping(params = "getProduct")
public void meth··(){
    ·······
}

————————————————————
@RequestMapping("/testRequestMap")
@ResponseBody
public String testRequestMap1(){
    return "testRequestMap1";
}

@RequestMapping("testRequestMap")
@ResponseBody
public String testRequestMap2(){
    return "testRequestMap2";
}

加不加 /  貌似没区别  官网都加/   

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值