HTTP method GET is not supported by this URL



浏览器中输入:http://localhost:8080/项目名/bookquery 后报错;

错误:

Type Status Report

Message HTTP method GET is not supported by this URL

Description The method received in the request-line is known by the origin server but not supported by the target resource.

Web.xml片段:

<servlet>
<servlet-name>bookQuery</servlet-name>
<servlet-class>action.BookQueryServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>bookQuery</servlet-name>
<url-pattern>/bookquery</url-pattern>
</servlet-mapping>
原因:
浏览器输入链接请求是doget()方式,而我在servlet里重写的是dopost方法.
改为上一层的service()方法即可



					


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM