aspose file tools*
The moose likes Servlets and the fly likes HelloWorldServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HelloWorldServlet" Watch "HelloWorldServlet" New topic
Author

HelloWorldServlet

Jeffrey Pony
Greenhorn

Joined: Jun 24, 2002
Posts: 25
Iam trying to deploy a simple HelloWorldServlet on ApacheTomcat4.1.18.
My web.xml is as follows

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

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

</web-app>


I do not have a package structure for the HelloWorldServlet.
The directory structure is :
jakarta-tomcat-4.1.18\webapps\chapter01\WEB-INF\classes with the class file residing in classes directory.

I also do not have the <servlet-mapping> specified intentionally.
The server is on running on port 8080 on my box.

I distinctly remember being able to invoke a servlet 'long back' back using
http://localhost:8080/chapter01/servlet/HelloWorldServlet
but fail to do so now.

Iam able to invoke the servlet if I set the servlet mapping.
What am I doing wrong or is my memory failing me.

Thanks in advance.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The invoker servlet is no longer enabled by default in tomcat.
See:
http://jakarta.apache.org/tomcat/faq/misc.html#evil
for more details.

If you wish to use it, you will need to uncomment the entry for it in the default web.xml under TOMCAT_HOME/conf.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Jeffrey Pony
Greenhorn

Joined: Jun 24, 2002
Posts: 25
Thanks Ben.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HelloWorldServlet