Reputation: 198
I am following WTP Tutorials Building and Running a Web Application
And when i run WebContent on the server(Tomcat 7) i get an error:
type Status report message /WTP-Tutorial-I/ description The requested resource (/WTP-Tutorial-I/) is not available.
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?
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>
Upvotes: 1
Views: 530
Reputation: 2655
according to your web.xml configuration there is no default servlet or route. therefore when you navigate to
localhost:8080/WTP-Tutorial-I
it will give you an error 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.
i read the tutorial and they have not created any default servlet or route. in the "Running the Application" section of tutorial they say navigate to SnoopServlet by using this url
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.
Upvotes: 1