Thanks, but...<G> I think you missed what I was after.. I wanted to be able to "back reference" to the parent directory of the web application in a link to an image..
Example: (trivial example)
Normally you would use a relative path to an image directory "IN" the web application like so..
<img name="help" src="images/menu_help.jpg" width="68" height="39" border=0 alt="Help">
... but if you wanted to use an image that was NOT in your web app.. (I have my reason, but I won't bore you with the details).. Normally in just plain HTML served by Apache I could..
<img name="help" src="../images/menu_help.jpg" width="68" height="39" border=0 alt="Help">
....to refer "back" to the parent directory which contains it's own "images" directory and refer to that directory via "../" syntax.
It seems that Tomcat does not support that kind of "relative" addressing to a parent directory..
Do you know a way around this...????
John...
Tom K wrote:
John, relative paths are always a headache (until you do some book-learning :-)). What I do is, right after my <HTML> tag I put in a line like this: <HTML> <BASE href='<%=request.getScheme()+"://"+request.getServerName()+":"+request.g etServerPort()+request.getContextPath()+"/" %>'>
What the line above does is gives you the full path as your base reference.
You can put 'kind-of' the same line in your regular html pages by using just the relative paths. Some may argue with the approach I use; if you include footers` and headers though and use the line right after your <HTML> tag your relative path will always be the same.
Tom Kochanowicz
-----Original Message-----
From: John B. Moore [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 14, 2004 6:27 PM
To: Tomcat Users List
Subject: Relative directory addressing to parent directory
Can't seem to get this to work....
Example: Under Tomcat/webapps I want an images directory that "any" of the web applications in that directory can access in their pages.
In static HTML (under Apache) I would use..
../images/myimage.jpg
and it would work just fine.. (the "../" would cause it to "backup" one folder to the parent and access the images directory directly under "webapps")
I can seem to get this to work within a JSP page in Tomcat (4.1.29)
As a test I created an HTML inwhich this works under Apache. Then changed it to a .jsp to run under Tomcat with the target image in /webapps/images/ and the app under /webapps/testapp.
Suggestions as to what I am missing...???
John..
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]