Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes trying to run hello world script but it is not Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "trying to run hello world script but it is not " Watch "trying to run hello world script but it is not " New topic
Author

trying to run hello world script but it is not

digvijay singh
Greenhorn

Joined: Dec 15, 2007
Posts: 2

please help i have tried various combination but none worked ...
examples are running well in tomcat but my web application' servlets are not.
so
i m using j2se , i know servlets is in j2ee, i am using dailup so can not download j2ee(120Mb)
i have downloaded servlet.jar file extracted it and keeping it in the same folder of my HelloWorldServlet.java compiled it.
inside ROOT\FPS\WEB-INF here is web.xml

<?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">

<display-name> my fps </display-name>
<description>
Welcome to Tomcat
</description>

<servlet>
<servlet-name>hello</servlet-name>
<servlet-class>HelloWorldServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>hello</servlet-name>
<url-pattern>/abc/hello</url-pattern>
</servlet-mapping>
</web-app>

inside ROOT\FPS\WEB-INF\classes\HelloWorldServlet.class is kept.

this is the url i type in tomcat
http://localhost:8080/FPS/abc/hello
and output was

HTTP Status 404 - /FPS/abc/login

type Status report

message /FPS/abc/hello

description The requested resource (/FPS/abc/hello) is not available.
Apache Tomcat/6.0.7

please i am pissed

[ December 15, 2007: Message edited by: Bear Bibeault ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
Welcome to JavaRanch.

ROOT\FPS\WEB-INF


The FPS directory should be in the webapps directory, not in the webapps/ROOT directory. ROOT is itself a web app, so you can't put another web app inside of it.


Ping & DNS - my free Android networking tools app
digvijay singh
Greenhorn

Joined: Dec 15, 2007
Posts: 2
thanks aaaaaaaa loooot i have spend 2 days trying to figure out why my servlets are not working ....... :roll:
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
Excellent. Just remember that JavaRanch is the place where you get answers to your questions
 
jQuery in Action, 2nd edition
 
subject: trying to run hello world script but it is not