SERVLET怎么运行

lovecff 2003-11-20 03:22:03
我在tomcat4.1.29下的webapps\ROOT\WEB-INF下建立classes文件架把webapps\examples\WEB-INF\classes\下的HelloWorldExample文件复制到过来
启动tomcat4.1.29地址为http://localhost:8080/servlet/HelloWorldExample
结果显示HTTP Status 404 - /servlet/HelloWorldExample

--------------------------------------------------------------------------------

type Status report

message /servlet/HelloWorldExample

description The requested resource (/servlet/HelloWorldExample) is not available.


--------------------------------------------------------------------------------

Apache Tomcat/4.1.29

为什么急切想知道
...全文
29 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
hnny 2003-11-20
  • 打赏
  • 举报
回复
web.xml中定义了很多东西,你将examples\WEB-INF整个目录下的东西都copy到你建的虚拟目录下中web-inf/classes就可以了
Leemaasn 2003-11-20
  • 打赏
  • 举报
回复
你必须在web.xml文件里配置一下新的servlet
即:
webapps\ROOT\WEB-INF\web.xml 文件里加上HelloWorldExample的定义,具体定义可以看原来文件里的

81,095

社区成员

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

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