File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Precompiled index.jsp - how to map to webroot? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Precompiled index.jsp - how to map to webroot?" Watch "Precompiled index.jsp - how to map to webroot?" New topic

Precompiled index.jsp - how to map to webroot?

Tina Coleman
Ranch Hand

Joined: Dec 12, 2001
Posts: 150
I've gotten my JSPs precompiled, and installed via a WAR under WEB-INF/classes. Previously, those JSPs were all in my APP_ROOT/ directory, and Apache "knew" that index.jsp or index.html were valid directory listings (via httpd.conf). However, since index.jsp is now hidden from Apache in WEB-INF, how do I handle setting up a default page for my application root?
Details: Tomcat is configured to serve all requests of form .jsp or .do via mod_jk. All other files are served by Apache.
Thoughts that have occurred to me:
* don't precompile index.jsp - leave it in the root
* use an index.html file to redirect to index.jsp
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

I personally don't recommend that the home page (index.jsp/html) be loaded with features and logic. For one thing, this is where I put my tests to see if client-side java, javascript, etc. are available so I don't try to make the rest of the webapp use things that don't work for that client.
In fact, most of the time, I'd choose HTML over a JSP just to guarantee that the "touchpoint" of the webapp works even should all else prove incompatible.
However, jsp or HTML, there's little benefit to precompiling unless you are attempting to perform heavyweight processing (which, as I said, I don't recommend). And since the first person that hits it will kick off the compile for the life of the service (+/-), why worry? Just put it in the app root.

An IDE is no substitute for an Intelligent Developer.
Tina Coleman
Ranch Hand

Joined: Dec 12, 2001
Posts: 150
Pre-compiling just so that we can turn off auto-reloading/compiling in Tomcat. Because we have a processing-intensive site, we're trying to squeeze out whatever extra time we can by paying attention to the details (pre-compiling, having Apache serve images, etc). Our pages themselves aren't particularly processing-intensive, but the business objects behind them generate map images on the fly, and that can take a little bit.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Precompiled index.jsp - how to map to webroot?
It's not a secret anymore!