tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ALEXANDROS KOTSIRAS" <ALEXANDRO...@prodigy.net>
Subject Re: Help setting up Tomcat environment for development
Date Thu, 13 Jul 2000 02:36:33 GMT
Just another practical Rules regarding the mappins :
You place all you servlets into projectname/web-inf/classes.
You place the jsp files in projectname/jsp
You place the static HTML in projectname/servlets

"projectname" is a folder that you will create under the "webapps" folder.
The path to your servlets is always "/projectName/servlet/ServletClassName"
where the class file of you servlet is "ServletClassName.class"
The pathto the JSP files is "/projectname/jsp/jspfile.jsp"
The path to static HTML is "/projectname/servlets/htmlfile.html"



You have to register you new project in the tomcat_home/conf/server.xml file
in exactly the same way that the "examples" one is listed in the end of the
server.xml file
----- Original Message -----
From: Bill Morrison <billmrsn@pacbell.net>
To: <tomcat-user@jakarta.apache.org>
Sent: Wednesday, July 12, 2000 8:10 PM
Subject: Re: Help setting up Tomcat environment for development


> Joe,
>
> I saw your msg to Mark & I have had exactly the same questions.   Could
you please
> fwd to me, as well at to Mark, the text of the msg you refer to?   Tks,
>
> bill
>
> Joe Franklin wrote:
>
> > I attached the text of a message I got from this list a couple months
ago
> > that helped me understand the webapp structure and how to configure my
> > first webapp.
> >
> > There's a section called RUNNING SERVLETS, and a section called CREATING
> > YOUR OWN SERVLET APPLICATION that explained it clearest for me.  This is
> > specific to 3.1, so if you're looking at 3.2b1, it might not help.
> >
> > Let me know and I'll forward you the actual message.
> >
> > jf
> >
> > At 06:32 PM 7/12/00 -0400, you wrote:
> > >I have a couple of questions, but first let me give you some
background.  I
> > >need to write a servlet or JSP page to call code I'm familiar with and
> > >display its output in HTML.  I'm under some severe time constraints.  I
have
> > >to have something working within one week!  I'm quite familiar with
Java,
> > >and HTML's pretty easy.  I've read the servlet half of the new book
"Core
> > >Servlets and JavaServer Pages" by Marty Hall, and I think I understand
how
> > >to do a simple servlet.  I'll be reading the JSP part of that book
tonight,
> > >and I expect that to be fairly straightforward as well.
> > >
> > >My problem is understanding how to set up the environment.  I just
> > >downloaded Tomcat 3.1 binaries for IBM's Unix (AIX 4.3).  In order to
put
> > >off having to learn to configure Apache and Tomcat together, I've
chosen for
> > >the next week to just run Tomcat as a stand-alone servlet container
(option
> > >1 in the Getting Started section of the "Tomcat Minimalistic User's
Guide").
> > >I've got it all set up, and I can connect to http://mytomcatserver:8080
and
> > >see Tomcat's home page.  I can run the examples from both the JSP
Examples
> > >page and the Servlet Examples page.
> > >
> > >Question 1:
> > >         I need to learn just enough to create my own application.
> > >Specifically, once I've written my .java and/or .jsp files, what
directory
> > >hierarchy do I need to create for them to live in?  What, if any,
config
> > >files do I need to edit to inform Tomcat of the new files?  Is there
step by
> > >step documentation on how to do that?  If so, where can I find it?
> > >
> > >         Two weeks from now the story may be very different, but for
the next
> > >week, I want to avoid installing and learning any new tools I don't
have to.
> > >So, if I can run javac by hand with the right arguments, I'd prefer to
do
> > >that instead of downloading 'ant' and having to learn yet another
Makefile
> > >syntax.
> > >
> > >Question 2:
> > >         I've looked under the webapps directory, and there seems to be
one
> > >subdirectory for each application.  I've been examining
> > >webapps/examples/servlets/helloworld.html, and there's something I
don't
> > >understand.  It has an "href" to "../servlet/HelloWorldExample", and
when I
> > >click on that link in my browser it takes me to
> > >http://mytomcatserver:8080/examples/servlet/HelloWorldExample.  BUT
> > >webapps/examples doesn't contain a "servlet" subdirectory - only
"servlets".
> > >I looked for files named "HelloWorldExample", and turned up
> > >HelloWorldExample.class and HelloWorldExample.java in
> > >webapps/examples/WEB-INF/classes.
> > >
> > >         There's obviously some mapping going on in order to get from
the URL
> > >to the filename, but I can't figure out what.  Is there a clause in
some
> > >config file which tells Tomcat that when it sees a reference to
> > >examples/servlet, it should look in examples/WEB-INF/classes instead?
> > >
> > >I will be eternally grateful for any help.
> > >
> > >         Mark Rosenthal
> >
>
  ------------------------------------------------------------------------
> >                           Name: tomcat - addapp.txt
> >    tomcat - addapp.txt    Type: Plain Text (text/plain)
> >                       Encoding: quoted-printable
>


Mime
View raw message