-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thomas,

On 3/20/2009 4:21 AM, Tomas Rodriguez wrote:
> but now I wanna have in other directory my web pages examples, for
> instance in d:\websites\examplesJSP,
> what variable I need to change in the apache tomcat for work?, what
> files in the server apache tomcat can I change?

I know this seems like a simple question, and users new to Tomcat (or
any servlet server) have a bit of difficulty, but it has a complex
answer. Let me try to explain things a little bit:

The most basic unit of work for a servlet container is the servlet
itself. JSP files are translated on the fly into Java classes which are
also servlets. Although the servlet is the most basic unit of work, the
"webapp" is really the focus of the server, and the concept that is most
difficult to grasp for someone coming from a PHP or Perl or other CGI
background.

A Java webapp is a collection of servlets, JSPs, static content, helper
classes, and libraries all bundled together, often into a WAR file. A
WAR file is just a JAR file with a specific directory layout to
facilitate webapp deployment.

A webapp needs to look like this (structurally):

/                The root of the webapp. Anything can go in here like
                 static content, subdirectories of static content, etc.
/WEB-INF         This directory contains webapp configuration files
/WEB-INF/web.xml This is the "deployment descriptor" which defines the
                 mapping from URLs to servlets, as well as some other
                 things. Read the web.xml from any Tomcat example
                 to get an idea of what you can do.
/WEB-INF/classes This directory contains your Java class files, in
                 package directories (like com/mycompany/MyClass.class)
/WEB-INF/lib     This directory contains any JAR files on which your
                 code depends.
/META-INF        This directory holds information about the JAR/WAR
                 itself. The "jar" utility will add a MANIFEST.MF file
                 here to indicate how it was created, etc.
/META-INF/context.xml This file is a Tomcat-specific deployment file.
                 You will want to look at some Tomcat examples for
                 more information. This file is optional if you
                 do not have any special configuration. Note that
                 in your case, you probably want one of these files,
                 and you probably want to use it to set up your
                 database connections.

This page gives you a start-to-finish example of how to build a web
application. I hope it helps:

http://www.adp-gmbh.ch/blog/2004/october/13.html

Unfortunately, most of the Tomcat documentation assumes that the reader
already knows all about Java webapps and just needs to know how to get
things running on Tomcat. That's because there is already so much
information out there online about Java webapps that the Tomcat folks
don't really need to repeat everything.

I hope that helps you out a bit.

Good luck,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknDqVgACgkQ9CaO5/Lv0PBg0wCdHAbw0YMojQKSlxK9CCIbMGC7
YzgAniWD6UGgLQgH0Po3TkKmKeWJVkNl
=FCuB
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to