我是导入了这三个类,并且调用了其中一个类的一个方法,不过最后在浏览器里面执行的时候报错拉 错误如下;type Status reportmessage HTTP method GET is not supported by this URLdescription The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).
message HTTP method GET is not supported by this URL http方法不支持你的这个url!?你是怎么访问你的servlet的?!你在web.xml中是怎么配置的!不会没有servlet的配置部署描述吧!
错误如下;type Status reportmessage HTTP method GET is not supported by this URLdescription The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).
http方法不支持你的这个url!?你是怎么访问你的servlet的?!你在web.xml中是怎么配置的!不会没有servlet的配置部署描述吧!
web.xml里配置如下:
<servlet>
<servlet-name>ScanServlet</servlet-name>
<servlet-class>mypack.ScanServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ScanServlet</servlet-name>
<url-pattern>/ScanServlet</url-pattern>
</servlet-mapping>
"url-pattern"写成这样试试<url-pattern>/scanServlet/*</url-pattern>(表示查找所有名称为scanServlet的mapping),访问url如下:http://localhost:端口/程序路径/scanServlet.这样试一下!!