servlet 问题 急!在线

runner4605 2003-08-23 10:45:19
我写了一个servlet,Chapter8.Servlet1放在%Catalina_homt%\webapps\test\WEB-INF\classes\Chapter8\Servlet1.class下但启动Tomcat Web服务器后,http://localhost:8085/test/servlet/Chapter8.Servlet1 却得到如下错误(端口设置正确)
HTTP Status 404 - /test/servlet/Chapter8.Servlet1

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

type Status report

message /test/servlet/Chapter8.Servlet1

description The requested resource (/test/servlet/Chapter8.Servlet1) is not available.


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

Apache Tomcat/4.1.24


但我将以上得Chapter8整个目录COPY到Tomcat自带得examples/Web-inf/classes/目录下时,http://localhost:8085/exmpales/servlet/Chapter8.Servlet1 servlet能正常工作,我想不是拼写问题,是deploy问题,请高手多多指教,急急急 !!!!!!!!!!!
...全文
32 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
runner4605 2003-08-24
  • 打赏
  • 举报
回复
谢谢各位,我已解决问题,同类得帖子还是很多得
黑马 2003-08-23
  • 打赏
  • 举报
回复
可能是你的web.xml的配置有问题吧
Yanbin_Q 2003-08-23
  • 打赏
  • 举报
回复
<web-app></web-app>中要加入

<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>
Yanbin_Q 2003-08-23
  • 打赏
  • 举报
回复
你的web.xml贴出来看看,要配置对,才能执行相应的servlet

81,092

社区成员

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

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