Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Precompiled index.jsp - how to map to webroot?

 
Tina Coleman
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18162
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tina Coleman
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic