tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Kaufman <WKauf...@viquity.com>
Subject RE: absolute pathing from context?
Date Wed, 25 Apr 2001 15:12:38 GMT
If you're talking about getting that directory from HTML (e.g., to embed an
image in your page), I'd suggest just referencing it directly, like,

    <img src="/images/guernica.gif" />

This lets you alias it in your webserver, to put the images directory
anywhere you like.

If you're trying to find it in your Java code, try
ServletContext.getRealPath().

                                                            -- Bill K.


> -----Original Message-----
> From: Matt Pease [mailto:matt@fullscreen.com]
> Sent: Wednesday, April 25, 2001 7:56 AM
> To: tomcat-user@jakarta.apache.org
> Subject: absolute pathing from context?
> 
> 
> Hi all -
> 
>   I don't understand how I should be linking from within my
> webapp.  Perhaps this is simply stated somewhere, sorry but I've 
> done my best to find it.
> 
>   For example, I'd like to be able to do this:
> 
>   from within my context app -- webapp:
> 
>   ....tomcat/webapps/myapp/
> 
>   I'd like to link to /images
> 
> I was hoping tomcat or something would be smart enough to 
> get from tomcat/webapps/myapp/images
> 
> 
> Any suggestions on doing this?
> 
> Thank you very much=
> Matt Pease
> 
> FullScreen, Inc.
> "we are almost done"
> 

Mime
View raw message