经常遇到这个问题,现在是一个很简单的程序,HelloWeb,一个jsp
一个Controller
然后就是servlet和springMVC的配置文件,访问http://localhost:8080/HelloWeb/hello
就出现这个错误
用fiddler去调试。你的 web 服务只支持 post,不支持get,所以直接在浏览器中看不到。
在浏览器的浏览框中输入url地址访问就是get请求,而你定义方法只能为post请求,当然会有问题,把POST换成GET就可以了。
Tomcat 报错信息如下:
HTTP Status 405 - Request method 'GET' not supported
type Status report
message Request method 'GET' not supported
description The specified HTTP method is not allowed for the ......
答案就在这里:Request method 'GET' not supported
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。
因为你规定了请求方法为post