Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

Repeated "load-on-startup" niggle

Chris Ward

2004-01-23



Hi all,

In my Tomcat setup I have a Context called "hal" which
contains all my applications, HTML everything.

 <Context path="/hal" docBase="hal" debug="0" privileged="true"
reloadable="true">

Therefore I run things with a URL such including "/hal"



Way back when I started with Tomcat I set the "Tomcat Root Context"
to point to the same docBase directory so any requests to "/page.html"
would resolve to "/hal/page.html".

 <!-- Tomcat Root Context -->
 <Context path="" docBase="hal" debug="0"/>


The problem I now have is that all the initialisation of /hal
is run twice. Once for each context. Since I have several
servlets with <load-on-startup> set this is a pain.

Question
========

What is the cleanest way to redirect requests made to "/" to "/hal"?
Can I do this by setting something up in the web.xml file for
the "/" context. Then I could remove the docBase="hal".



Best regards
Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.