开发者社区> 问答> 正文

ajax post请求 400 请求报错 

function getContent(){        $.post(                "post/list_json.jspx",                {first:first,count:count,systemmsg:'c114'},                function(data) {},            "json"        );     } @RequestMapping(value="/post/list_json.jspx",method = RequestMethod.POST)     public void getJsonList(Integer first,Integer count,String ,systemmsgHttpServletRequest request,HttpServletResponse  response) {         }   严重: Servlet.service() for servlet [JeeBbsFront] in context with path [/sdmcbbs] threw exception [Request method 'POST' not supported] with root cause org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported     at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter$ServletHandlerMethodResolver.resolveHandlerMethod(AnnotationMethodHandlerAdapter.java:623)     at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:421)     at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)     at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)  

展开
收起
kun坤 2020-05-28 16:04:20 676 0
1 条回答
写回答
取消 提交回答
  • 这个错误是说你有地方用post 来访问这个请求/sdmcbbs, 但是没有对应的controller. 但是看你的js代码,又不是访问这个请求. 要不试着改成这样看看,其实最方便应该直接在浏览器F12来调试.  

    $.post(                "/post/list_json.jspx",                {first:first,count:count,systemmsg:'c114'},                function(data) {},            "json"        );
     

    2020-05-29 13:05:48
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载