我有一个名为“testUrBuddy.html”的HTML文件。我想在本地主机上运行此文件。我安装了Tomcat 6服务器。当我运行服务器时,我得到这些日志:
Jul 31, 2014 5:40:21 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_55\bin; ...
Jul 31, 2014 5:40:22 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Jul 31, 2014 5:40:22 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 600 ms
Jul 31, 2014 5:40:22 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina
Jul 31, 2014 5:40:22 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.37
Jul 31, 2014 5:40:22 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080
Jul 31, 2014 5:40:22 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009
Jul 31, 2014 5:40:22 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=1/16 config=null Jul 31, 2014 5:40:22 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 390 ms
这意味着我的服务器正在运行。我将testUrBuddy.html文件放在webapps \ ROOT文件夹中。运行服务器后,当我在URL上键入http://localhost:8080/testUrBuddy.html
时,我收到此错误:
HTTP Status 404 - /testUrBuddy.html description The requested resource is not available.
我是否在web.xml或其他地方更改了某些内容?。
答案 0 :(得分:0)
您需要将文件添加到Web项目中。该项目至少需要一个包含web.xml文件的WEB-INF文件夹。如果您使用的是Eclipse,请执行以下操作: