You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by colin diggensworth <cd...@yahoo.com> on 2003/02/08 22:10:22 UTC
deploying simple servlet
Hi, I am running Tomcat version 4.1 with JDK1.3.1 onWin98. I can run all the Tomcat examples servlets no problem. I am trying to run a simple servlet. I do the following:
(1)Write a simple Servlet called HelloWorld
(2)I compile the servlet and put it in under webapps/Root/Web-Inf/classes.
(3)I start Tomcat. My understanding is that Tomcat finds any new servlet classes automatically - I could be wrong here.
(4) I type the following URL in my Web browser http://localhost:8080/servlet/HelloWorld I get the http 404 resource not found error message.
I would like to know
(1) Is there anything else I have to do so that Tomcat knows that there is a new Servlet - update some .xml file or something
(2) Is there anyway I can make check to see what Servlets Tomcat has loaded?
(3) Is there anything else I have to do to make sure the webbrowser can see the servlet?
Remember I can access all example servlet without a problem so I am confident my references to JDK etc. which Tomcat must have are all okay. Many Thanks CD
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
Re: deploying simple servlet
Posted by Bill Barker <wb...@wilshire.com>.
"colin diggensworth" <cd...@yahoo.com> wrote in message
news:20030208211022.22367.qmail@web41212.mail.yahoo.com...
>
> Hi, I am running Tomcat version 4.1 with JDK1.3.1 onWin98. I can run all
the Tomcat examples servlets no problem. I am trying to run a simple
servlet. I do the following:
>
> (1)Write a simple Servlet called HelloWorld
>
> (2)I compile the servlet and put it in under webapps/Root/Web-Inf/classes.
>
> (3)I start Tomcat. My understanding is that Tomcat finds any new servlet
classes automatically - I could be wrong here.
>
You are wrong here if your version is >= 4.1.12.
> (4) I type the following URL in my Web browser
http://localhost:8080/servlet/HelloWorld I get the http 404 resource not
found error message.
>
> I would like to know
>
> (1) Is there anything else I have to do so that Tomcat knows that there is
a new Servlet - update some .xml file or something
>
You could enable the Invoker for your webapp, or, better, define the
servlet-mapping yourself in your web.xml. See the release notes.
> (2) Is there anyway I can make check to see what Servlets Tomcat has
loaded?
With some JVMs (notibly IBM's) this is possible. With others it is not (at
least for TC <= 4.1).
>
> (3) Is there anything else I have to do to make sure the webbrowser can
see the servlet?
>
> Remember I can access all example servlet without a problem so I am
confident my references to JDK etc. which Tomcat must have are all okay.
Many Thanks CD
>
The 'examples' webapp enables the Invoker servlet. Use that web.xml file as
an example if you want to go this route.
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org