Thread: 404 Not Found
View Single Post
  #4 (permalink)  
Old 11-05-2007, 09:12 PM
goodguy052 goodguy052 is offline
Member
 
Join Date: Nov 2007
Posts: 2
goodguy052 is on a distinguished road
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 servlet

Last edited by goodguy052 : 11-05-2007 at 09:14 PM. Reason: forgot to add some more info
Reply With Quote