tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Ward" <cw...@horizon-asset.co.uk>
Subject RE: Repeated "load-on-startup" niggle
Date Fri, 23 Jan 2004 15:35:00 GMT


Hi,

This would be fine if the everyone started at the entry level of the
web site, but a lot of my problems are caused by including/importing
resources like javascript files, servlets, etc. etc.

e.g.	Most od my generated HTML files have

	<SCRIPT SRC="/JavaScript/HAL_CommonJavaScript.js" 
		LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">  
	</SCRIPT>

But that JavaScript file really should be

	/hal/JavaScript/HAL_CommonJavaScript.js

So it would never see the redirection from /index.html.  	

I was lazy in the early stages and now it's biting me in the bum!



> 
> I guess I'm imagining this situation...
> 
> www.foo.com/
> 
> and 
> 
> www.foo.com/hal/
> 
> Someone types in the first one, because they're lazy.  
> Immediately they're redirected to /hal, and from then on, 
> they stay there.
> 
> ie: There's nothing at all at / other than the redirect. 
> (he'd modify the root context to be NOT the same docbase as /hal)
> 
> > -----Original Message-----
> > From: Shapira, Yoav [mailto:Yoav.Shapira@mpi.com]
> > Sent: Friday, January 23, 2004 9:10 AM
> > To: Tomcat Users List
> > Subject: RE: Repeated "load-on-startup" niggle
> > 
> > 
> > 
> > Howdy,
> > But he wants to redirect all requests, not just those for /.
> > 
> > Yoav Shapira
> > Millennium ChemInformatics
> > 
> > 
> > >-----Original Message-----
> > >From: Mike Curwen [mailto:mikec@gb-im.com]
> > >Sent: Friday, January 23, 2004 10:10 AM
> > >To: 'Tomcat Users List'
> > >Subject: RE: Repeated "load-on-startup" niggle
> > >
> > >Is it simpler in this case to have an index.html file 
> sitting at '/'
> > and
> > >all it does is a meta refresh to the '/hal' context?
> > >
> > >That way, once you're at /hal, you'll stay at /hal, and won't worry
> > >about request parameters, etc.
> > >
> > >> -----Original Message-----
> > >> From: Chris Ward [mailto:cward@horizon-asset.co.uk]
> > >> Sent: Friday, January 23, 2004 9:02 AM
> > >> To: Tomcat Users List
> > >> Subject: RE: Repeated "load-on-startup" niggle
> > >>
> > >>
> > >> Thanks.  That's exactly what I'd started to use.  What's 
> the best 
> > >> way to add the "/hal" and redirect while
> > preserving all the
> > >> request parameters etc.
> > >>
> > >> i.e.
> > >>
> > >> 	Original URL = /somedir/somefile.html
> > >>
> > >> 	Filtered URL = /hal/somedir/somefile.html
> > >>
> > >> Should I be using a request dispatcher or response.sendRedirct()?
> > >>
> > >> I'm trying to do it in the best way.
> > >>
> > >> Best regards
> > >> Chris
> > >>
> > >> --
> > >>
> > >> Chris Ward, Horizon Asset Limited
> > <mailto:cward@horizon-asset.co.uk>
> > >> Tel +44 (20) 7367 7028, Fax 7367 7029
> > >>
> > >> --
> > >>
> > >>
> > >> THIS E-MAIL MAY CONTAIN CONFIDENTIAL AND/OR PRIVILEGED
> > INFORMATION.
> > >> IF YOU ARE NOT THE INTENDED RECIPIENT (OR HAVE RECEIVED
> > THIS E-MAIL
> > >> IN ERROR) PLEASE NOTIFY THE SENDER IMMEDIATELY AND 
> DESTROY THIS E-
> > >> MAIL.  ANY UNAUTHORISED COPYING, DISCLOSURE OR 
> DISTRIBUTION OF THE 
> > >> MATERIAL IN THIS E-MAIL IS STRICTLY FORBIDDEN.
> > >>
> > >>          HORIZON ASSET LIMITED IS AUTHORISED AND REGULATED
> > >>                 BY THE FINANCIAL SERVICES AUTHORITY.
> > >>
> > >>
> > >>
> > >> > -----Original Message-----
> > >> > From: Shapira, Yoav [mailto:Yoav.Shapira@mpi.com]
> > >> > Sent: Friday, January 23, 2004 2:43 PM
> > >> > To: Tomcat Users List
> > >> > Subject: RE: Repeated "load-on-startup" niggle
> > >> >
> > >> >
> > >> >
> > >> > Howdy,
> > >> > A javax.servlet.Filter is one nice clean way.
> > >> >
> > >> > Yoav Shapira
> > >> > Millennium ChemInformatics
> > >> >
> > >> >
> > >> > >-----Original Message-----
> > >> > >From: Chris Ward [mailto:cward@horizon-asset.co.uk]
> > >> > >Sent: Friday, January 23, 2004 5:34 AM
> > >> > >To: Tomcat Users List
> > >> > >Subject: Repeated "load-on-startup" niggle
> > >> > >
> > >> > >
> > >> > >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@jakarta.apache.org
> > >> > >For additional commands, e-mail:
> > >> tomcat-user-help@jakarta.apache.org
> > >> >
> > >> >
> > >> >
> > >> >
> > >> > This e-mail, including any attachments, is a
> > confidential business
> > >> > communication, and may contain information that is 
> confidential,
> > >> > proprietary and/or privileged.  This e-mail is 
> intended only for 
> > >> > the individual(s) to whom it is addressed, and may not 
> be saved, 
> > >> > copied, printed, disclosed or used by anyone else.  If 
> > you are not
> > >> > the(an) intended recipient, please immediately delete
> > this e-mail
> > >> > from your computer system and notify the sender.  Thank you.
> > >> >
> > >> >
> > >> >
> > >> 
> > 
> ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail:
> > tomcat-user-unsubscribe@jakarta.apache.org
> > >> > For additional commands, e-mail:
> > tomcat-user-help@jakarta.apache.org
> > >> >
> > >> >
> > >>
> > >> 
> > 
> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: 
> tomcat-user-unsubscribe@jakarta.apache.org
> > >> For additional commands, e-mail:
> > tomcat-user-help@jakarta.apache.org
> > >>
> > >
> > >
> > 
> >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: 
> tomcat-user-help@jakarta.apache.org
> > 
> > 
> > 
> > 
> > This e-mail, including any attachments, is a confidential
> > business communication, and may contain information that is 
> > confidential, proprietary and/or privileged.  This e-mail is 
> > intended only for the individual(s) to whom it is addressed, 
> > and may not be saved, copied, printed, disclosed or used by 
> > anyone else.  If you are not the(an) intended recipient, 
> > please immediately delete this e-mail from your computer 
> > system and notify the sender.  Thank you.
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message