aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
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
Author

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: 16140
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Precompiled index.jsp - how to map to webroot?