Servlet问题

来源:互联网 发布:实用 双肩包 知乎 编辑:程序博客网 时间:2024/06/06 15:50

1、访问某Servlet时报错如下:

 

type: Status report

message: HTTP method GET is not supported by this URL

description: The specified HTTP method is not allowed for the requested resource (HTTP

method GET is not supported by this URL).

 

解决办法:在相应的doGet或doPost方法中加入  response.setContentType("text/html");

 

原创粉丝点击