Well.  I think is better to tell you how I did to make a servlet work.
First of all I created a folder under "webapps" (e.g. miFirstServlet).
After that I put a simple html file called index.html inside this folder.

Example of simple index.html:
<html>
<head><title>My first servlet</title></head>
<body>
<h1>This is really my first servlet!</h1>
<a href=http://localhost:8080/miFirstServlet/servlet/miFirstServlet/First>Click here 
to see the servlet working</a>
</body>
</html>

Explanation of the URL:
/miFirstServlet    :  the name of the application folder
/servlet           :  indicates that is a servlet (see down).
/miFirstServlet    :  name of the package
/First             :  name of the class

Put First.class in webapps/WEB-INF/classes/miFirstServlet/.
(make sure the name of the package of First.class is "miFirstServlet")

The web.xml file is simple an is explained inside the example web.xml
file that you can download at:
http://localhost:8080/tomcat-docs/appdev/deployment.html
Make sure to declare the servlet and his <servlet-class> like this:
...
     <servlet-class>miFirstServlet.First</servlet-class>
...

This file goes here:
webapps/WEB-INF/.

What you are doing is putting an application on Tomcat.  There are
2 ways of doing so:
1) Doing what I have just explained before.
2) Putting a .war instead of the folder webapps/miFirstServlet 
   (e.g. miFirstServlet.war)

I hope this can help you. Bye,

Mauro



On Mon, 9 Sep 2002, srilatha sagar wrote:

> Hi!
> 
> 
> I've copied the .class files
> c:\tomcat4\webapps\ROOT\WEB-INF\classes
> 
> 
> I've include the following lines in autoexec.bat:
> set JAVA_HOME=c:\jdk1.2
> set
> CLASSPATH=.;C:\tomcat4\common\lib\servlet.jar;%CLASSPATH%
> 
> set PATH=%PATH%;%JAVA_HOME%\bin
> 
> I've uncommented the following line in
> c:\tomcat4\conf\server.xml: 
> <Context path="" docBase="ROOT" debug="0"/>
> 
> 
> I did not create the web.xml.If required,where should
> it be created and what should be included in that
> file.
> 
> I've wriiten a simple servlet and not in a package,and
> the URL to access it is:
> (First.class is the servlet)
> 
> http://localhost:8080/First
> 
> 
> Thanks,
> SriLatha.
> 
> 
> 
> --- Mauro Daniel Ardolino <[EMAIL PROTECTED]>
> wrote:
> > Some questions:
> > 
> > Where did you put the files of your applications?
> > (*.class, *.jsp, *.html)
> > Did you create the web.xml file?
> > If so, did you declare your servlet there?
> > How did you write the URL to access your servlet?
> > Is your servlet in a package?
> > 
> > 
> > More information at:
> >
> http://localhost:8080/tomcat-docs/appdev/deployment.html
> > 
> > (notice "localhost:8080" means in your own PC with
> > Tomcat running).
> > 
> > 
> > Mauro
> > 
> > 
> > 
> > On Mon, 9 Sep 2002, srilatha sagar wrote:
> > 
> > > Hi!
> > > I've installed tomcat 4.0 and jdk1.2 on windows 98
> > > machine.The server is installed and i'm able to
> > run
> > > the examples/jsp and examples/servlet files.
> > > 
> > > But when it comes to my own Servlet files,it's
> > giving
> > > the error:HTTP 404,file not found.
> > > 
> > > Please let me know,as how to configure tomcat 4.0
> > on
> > > win98 machine,so as to execute servlets and also
> > where
> > > to set the environment variables,and which system
> > > files to be updated for configuration.
> > > 
> > > Thanks,
> > > SriLatha.
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Finance - Get real-time stock quotes
> > > http://finance.yahoo.com
> > > 
> > > --
> > > To unsubscribe, e-mail:  
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > 
> > > 
> > 
> > -- 
> > Ing.Mauro Daniel Ardolino
> > Departamento de Desarrollo y Servicios
> > Altersoft
> > Billinghurst 1599 - Piso 9
> > C1425DTE - Capital Federal
> > Tel/Fax: 4821-3376 / 4822-8759
> > mailto: [EMAIL PROTECTED]
> > website: http://www.altersoft.com.ar
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
> http://finance.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 

-- 
Ing.Mauro Daniel Ardolino
Departamento de Desarrollo y Servicios
Altersoft
Billinghurst 1599 - Piso 9
C1425DTE - Capital Federal
Tel/Fax: 4821-3376 / 4822-8759
mailto: [EMAIL PROTECTED]
website: http://www.altersoft.com.ar


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to