You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Richard Evans <rd...@webtrak.co.uk> on 2000/08/29 11:51:31 UTC

Deployment directory structure

I'm a new tomcat user, apologies if this is a dumb question ...

I'm investigating replacing an existing app server (JWS 1.1) with
Apache/Tomcat, so I can get access to the later servlet APIs.

I've read the tomcat docs on webapps and it seems that I am required to place
my web pages and servlet classes in the same directory structure.  This is
not how we have things set up (different teams develop web content and
servlets).

Are there any options which I haven't seen for splitting up the web and code
content?  I guess I could put my servlet classes in the JVM CLASSPATH but that
loses the option of auto reload, etc.

Any help appreciated

Richard

RE: Deployment directory structure

Posted by Toby Piper <tp...@CompCraft.com>.
Yes, you can put them in different paths. Look at the advanced context for the
examples. Although you don't actually have to use that as long as you put the
html pages in a different directory. The advanced context config is really so
that you don't have the servlet/JSP engine serving the static html pages (which
is slower than if the web server serves them) which are mixed with JSP.

We created a virtual directory for our html pages and created a different
servlet context (and path) for the servlets. You just have to specify the
servlet context path in the html page when referencing the servlet or JSP.

Then just set docbase to the full path when creating the context.

So if html pages are in dir "A" and servlets/JSP are in dir "B" and a context is
created called "tools" with docbase pointing to B then in your html you would
reference "tools/myjsp.jsp" or "tools/servlet/myclass".
This might be off slightly but you get the general idea.

> -----Original Message-----
> From: Richard Evans [mailto:rde@webtrak.co.uk]
> Sent: Tuesday, August 29, 2000 2:52 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Deployment directory structure
>
>
> I'm a new tomcat user, apologies if this is a dumb question ...
>
> I'm investigating replacing an existing app server (JWS 1.1) with
> Apache/Tomcat, so I can get access to the later servlet APIs.
>
> I've read the tomcat docs on webapps and it seems that I am required to place
> my web pages and servlet classes in the same directory structure.  This is
> not how we have things set up (different teams develop web content and
> servlets).
>
> Are there any options which I haven't seen for splitting up the web and code
> content?  I guess I could put my servlet classes in the JVM CLASSPATH but that
> loses the option of auto reload, etc.
>
> Any help appreciated
>
> Richard
>