Results 1 to 6 of 6
Thread: 404 Not Found
- 08-02-2007, 01:13 PM #1
Member
- Join Date
- Jul 2007
- Posts
- 51
- Rep Power
- 0
404 Not Found
When I try to run the servlet the server return to me and exception
I created servlet "HelloWorld" and saved it under webapps>ROOT>utils>WEB-INF>classes.
I created the web.xml file to map it, and I saved it under webapps>ROOT>utils>WEB-INF.
when I click http://localhost:8080/utils/hello to run servlet, appears:
404 Not Found /utils/hello was not found on this server.
what's the problem?
- 08-03-2007, 10:04 AM #2
Member
- Join Date
- Aug 2007
- Posts
- 47
- Rep Power
- 0
Hi,
It could be your web.xml file. U have to do the right mapping between the page and the .class file.
Try to show us your web.xml please.
Bye.
- 08-05-2007, 04:01 AM #3
Member
- Join Date
- Jul 2007
- Posts
- 51
- Rep Power
- 0
I created the web.xml file to map it, the web.xml look likes below and saved it under webapps>ROOT>utils>WEB-INF.
Java Code:<web-app xmlns="http://sor.com/ns/resin"> <servlet servlet-name="hello" servlet-class="Hello"/> <servlet-mapping url-pattern="/hello" servlet-name="hello"/> </web-app>
- 11-05-2007, 07:12 PM #4
Member
- Join Date
- Nov 2007
- Posts
- 2
- Rep Power
- 0
take the utils directory from root and place it under webapps directory. so, now new path is tomcat>webapps>utlis>WEB-INF>
make new dir classes under WEB-INF and place the class Hello in classes.
make web.xml as follows and place it under WEB-INF:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet>
<servlet-name>hello</servlet-name>
<servlet-class>Hello</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>hello</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
</web-app>
This will work
and type the following url in browsers address bar:
http://localhost:8080/utils/hello
to run servletLast edited by goodguy052; 11-05-2007 at 07:14 PM. Reason: forgot to add some more info
- 11-06-2007, 08:30 PM #5
Member
- Join Date
- Nov 2007
- Posts
- 2
- Rep Power
- 0
better way u can use this structure
In webapps create MyApps in that create WEB-INF in this u can copy that web.xml file.
In WEB-INF create classes folder.
- 11-07-2007, 10:15 AM #6
Member
- Join Date
- Nov 2007
- Posts
- 7
- Rep Power
- 0
since it is a servlet... i think the url should be http://localhost:8080/utils/servlet/hello
if you are using tomcat
Similar Threads
-
Class not found Exception
By surendra in forum Java ServletReplies: 8Last Post: 06-09-2011, 12:52 PM -
struts No Collection Found
By orchid in forum Web FrameworksReplies: 3Last Post: 02-18-2010, 05:37 PM -
could not be found in the registry
By alam99 in forum EclipseReplies: 0Last Post: 01-08-2008, 08:21 AM -
ConnectException not found
By tamayo in forum New To JavaReplies: 1Last Post: 07-23-2007, 08:23 AM -
Hibernate table not found
By orchid in forum JDBCReplies: 2Last Post: 05-06-2007, 07:44 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks