前端到后端------HTTP Status 405 ( The specified HTTP method is not allowed for the requested resource )

我的报错如下:


可我前端ajax里标注了“method:'post',”,后台“method=RequestMethod.POST”,自始至终都Get没关系呀,很纳闷究竟怎么跑出来的GET;而且根据url请求根本就没进入到方法体里;




我的解决方法:



至于为什么这样,好像是说不加request、response的话,就会调用父类HttpServlet里的doGet()方法,而父类HttpServlet的doGet方法默认返回上图的405错误!

猜你喜欢

转载自blog.csdn.net/jim_007/article/details/79355122