加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – Eclipse,tomcat,404错误

发布时间:2020-12-15 02:49:56 所属栏目:Java 来源:网络整理
导读:我正在学习servlet并遵循 this教程(我一步一步地遵循,但我将项目命名为“SampleServlet”而不是“de.vogella.wtp.filecounter”).当我启动服务器(步骤5.4)时,我收到404页面错误: HTTP Status 404 - /SampleServlet/servlet/de.vogella.wtp.filecounter.serv
我正在学习servlet并遵循 this教程(我一步一步地遵循,但我将项目命名为“SampleServlet”而不是“de.vogella.wtp.filecounter”).当我启动服务器(步骤5.4)时,我收到404页面错误:
HTTP Status 404 - /SampleServlet/servlet/de.vogella.wtp.filecounter.servlets.FileCounter
type Status report
message /SampleServlet/servlet/de.vogella.wtp.filecounter.servlets.FileCounter
description The requested resource (/SampleServlet/servlet/de.vogella.wtp.filecounter.servlets.FileCounter) is not available.

从哪里开始调试?服务器启动时,控制台中有几个“INFO”,一个警告:

29.08.2011 21:03:44 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SampleServlet' did not find a matching property.

我需要更改任何偏好吗?

解决方法

本教程建议您在 http://localhost:8080/de.vogella.wtp.filecounter/FileCounter之前调用它.项目名称默认为上下文名称de.vogella.wtp.filecounter,您已将其更改为SampleServlet,因此需要在 http://localhost:8080/SampleServlet/FileCounter之前调用servlet.

也可以看看:

> Our Servlets wiki page

至于SetPropertiesRule警告,只需忽略它,这是正常的. Eclipse只是为Tomcat的< Context>添加了一个额外的属性.元素,以便能够将部署的webapp与特定项目相关联. Tomcat只是抽搐,因为它不能将它识别为预定义的< Context>之一.属性.然而,它试图帮助最终用户实际上输入错误的情况等等.只是忽略它.导出Web应用程序并将其部署到实际生产服务器上时,您将看不到它.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读