springframework Request method 'GET' not supported

来源:互联网 发布:知乎怎么用 编辑:程序博客网 时间:2024/06/08 09:11

javaweb开发的时候碰见这个错误,写下来,记录一下

org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver.handleHttpRequestMethodNotSupported(198) | Request method ‘GET’ not supported

这是js的代码,请求的时候默认的是get请求

$("#outBtn").click(function (){    var url=sysurl+"pay/outExcel";    window.open(url);});

而后端的代码是这样

 @ResponseBody    @RequestMapping(value ="/outExcel",method = RequestMethod.**POST**)//注意这里给成get请求就好了    public void outExcell(HttpServletRequest request,HttpServletResponse response) throws Exception{
阅读全文
0 0
原创粉丝点击