|
I'm new to Tomcat 3.2.1 and Servlet 2.2 in
particular, having just come from JRun before webapps made their
debut.
I'm struggling with the "best practices" people are
using for storing their JSPs and Java class files in the webapps directory,
while storing images and html files in the web server directory
root.
For example, in Apache 1.3.14, my document root is
htdocs and I am putting some files there for serving by apache,
like:
htdocs/images/a.gif
htdocs/images/b.gif
htdocs/index.jsp <--
empty dummy file workaround so that Apache will send a request for "/" to
Tomcat's ROOT index.jsp
htdocs/app.js
htdocs/app.css
etc...
And in my webapps under Tomcat I have:
webapps/ROOT/index.jsp <-- the
actual index.jsp served up when I enter "/" for apache
webapps/ROOT/WEB-INF/classes/ (all of
my class files needed just by the index.jsp file)
webapps/pub/index.jsp
webapps/pub/company.jsp
webapps/pub/news.jsp
webapps/pub/WEB-INF/classes/ (all the
class files needed by 'pub' application, even though they are the same as those
for ROOT).
My questions are:
1) This separation of the JSP files from stuff like
images, javascripts, stylesheets when deployed seems like a pain since they need
to be in the same directory when I'm using my editing tools (like
Dreamweaver). Only when I deploy do I need to move the static files to the
apache locations and the JSPs to the Tomcat webapps area. Don't others
find this to be a pain, or I am just not doing it right?
2) The ROOT and pub applications are really not
distinct applications, only a separation of JSPs and such from the root to a
public directory. I had this subdirectory structure back before webapps,
and they were done to organize the JSPs into logical groups like how all HTML
sites are done. They are not put into separate subdirectories because they
are separate webapps. Can a single webapp support multiple directories, or
at least a directory and all subdirectories? Perhaps ROOT is just abnormal
because everybody wants a page to be displayed when they enter your URL like http://myeastside.com/
3) When Java classes are shared by several webapps,
they have to appear in each of the webapps' WEB-INF/classes directories.
Is that what people are doing, or are they JARing them up and then putting them
in a common location (like Tomcat's 'lib') to be shared by all?
Any thoughts will help. The separation forced
by the webapps concept seems broken to me since it seems unlikely that web
servers and their standard document root processing is not going to go away
anytime soon (we still have PHP, CGI, images, etc. besides JSPs).
David
|
- Re: Blending webapps with HTML files David Wall
- Re: Blending webapps with HTML files Geoff Lane
- Re: Blending webapps with HTML files Martin Smith
- RE: Blending webapps with HTML files Stefan Langer
- RE: Blending webapps with HTML files Kitching Simon
