希望这里有乐于助人的高手,指点一下啊

fhj2006 2007-06-19 08:41:04
我按照网上的套路,已经运行成功了一个servlet的例子,但是再运行其他的又出错了,

第一个例子的web.xml
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<display-name>My Web Application</display-name>
<description>
A application for test.
</description>

<servlet>
<servlet-name>HTTPGetServlet</servlet-name>
<servlet-class>HTTPGetServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HTTPGetServlet</servlet-name>
<url-pattern>/HTTPGetServlet</url-pattern>
</servlet-mapping>
</web-app>
这个运行成功了,我把另外一个.class放在相同文件夹下,但是不知道应该怎么写web.xml

我将另外一个.class拷贝到Tomcat 5.5\webapps\myapp\WEB-INF\classes下,并且把web.xml中的servlet名都改了,但是出错:
HTTP Status 405 - HTTP method GET is not supported by this URL

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).
Apache Tomcat/5.5.17

谁能指点一下啊,谢谢
...全文
107 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

23,407

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧