Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HelloWorldServlet

 
Jeffrey Pony
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jeffrey Pony
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ben.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic