简体   繁体   English

Eclipse WTP教程错误

[英]Eclipse WTP Tutorial Error

I am following WTP Tutorials Building and Running a Web Application 我正在遵循WTP教程构建和运行Web应用程序

And when i run WebContent on the server(Tomcat 7) i get an error: 当我在服务器(Tomcat 7)上运行WebContent时,出现错误:

type Status report message /WTP-Tutorial-I/ description The requested resource (/WTP-Tutorial-I/) is not available. 类型状态报告消息/ WTP-Tutorial-I /描述所请求的资源(/ WTP-Tutorial-I /)不可用。

Now on the tutorial it says it should direct me to /snoop , which it does not, but when i type it in manually (localhost:8080/WTP-Tutorial-I/snoop) it works any body know why this is? 现在在教程上它说它应该将我定向到/ snoop,但不是,但是当我手动键入它(localhost:8080 / WTP-Tutorial-I / snoop)时,任何机构都知道这是为什么吗?

web.xml: web.xml中:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>WTP-Tutorial-I</display-name> 
<servlet>
<servlet-name>Snoop Servlet</servlet-name>
<servlet-class>org.eclipse.wtp.tutorial.SnoopServlet</servlet-class>
</servlet>  
<servlet-mapping>
<servlet-name>Snoop Servlet</servlet-name>
<url-pattern>/snoop/*</url-pattern>
</servlet-mapping>
</web-app>  

according to your web.xml configuration there is no default servlet or route. 根据您的web.xml配置,没有默认的servlet或路由。 therefore when you navigate to 因此,当您导航到

localhost:8080/WTP-Tutorial-I

it will give you an error resource not found . 它会给你一个错误resource not found

but when you navigate to 但是当您导航到

localhost:8080/WTP-Tutorial-I/snoop

it runs the org.eclipse.wtp.tutorial.SnoopServlet which is mapped in the web.xml file. 它运行org.eclipse.wtp.tutorial.SnoopServlet ,该映射在web.xml文件中。

i read the tutorial and they have not created any default servlet or route. 我阅读了教程,他们还没有创建任何默认的servlet或路由。 in the "Running the Application" section of tutorial they say navigate to SnoopServlet by using this url 在教程的“运行应用程序”部分中,他们说,使用此URL导航到SnoopServlet。

http://localhost:8080/tutorial/snoop

so you are following the tutorial in the right way. 因此,您以正确的方式遵循了本教程。 there is no error according to tutorial. 根据教程没有错误。 one more thing, the tutorial is written in 2004, you need to search for some new tutorials since you are using tomcat 7. 还有一件事,该教程写于2004年,由于您使用的是tomcat 7,因此需要搜索一些新教程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM