This goes against the grain of the servlet spec. Generally, images would be something tied to a web application and would therefore be contained within the application war file (or directory) so that the webapp would be deployed as a single unit.

...but I'm not a puriest so have at it :P

One option is to use a servlet that serves static files from directories and map that servlet in your web application's web.xml. This is nowhere near as robust or secure as putting httpd infront of your servlet containers. Again since this _could_ point outside the application directory it's a poor solution.

Otherwise (as in Carl's suggestion): You can "overlap" URI mappings to contexts.

So you can map:

/app1  ->   fooApplication.war
/app1/images  -> /usr/home/tomcat/images

as long as your images directory is a deployable web application.


----Original Message Follows----
From: "Mike Curwen" <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: Is there such a beast ? (virtual directories)
Date: Tue, 13 Jul 2004 10:12:56 -0500
MIME-Version: 1.0
Received: from mail.apache.org ([209.237.227.199]) by mc4-f28.hotmail.com with Microsoft SMTPSVC(5.0.2195.6824); Tue, 13 Jul 2004 08:13:17 -0700
Received: (qmail 41774 invoked by uid 500); 13 Jul 2004 15:13:05 -0000
Received: (qmail 41755 invoked by uid 99); 13 Jul 2004 15:13:05 -0000
Received: from [139.142.220.22] (HELO brad.globallyboundless.com) (139.142.220.22) by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 13 Jul 2004 08:13:02 -0700
Received: from BALTHAZAR ([10.0.0.111])by mail.gb-im.com (8.10.2/8.10.2) with ESMTP id i6DFCuV12696for <[EMAIL PROTECTED]>; Tue, 13 Jul 2004 10:12:56 -0500
X-Message-Info: JGTYoYF78jFNeFApfa+UFHTL+Uj4Gjtk
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
List-Subscribe: <mailto:[EMAIL PROTECTED]>
List-Help: <mailto:[EMAIL PROTECTED]>
List-Post: <mailto:[EMAIL PROTECTED]>
List-Id: "Tomcat Users List" <tomcat-user.jakarta.apache.org>
Delivered-To: mailing list [EMAIL PROTECTED]
X-ASF-Spam-Status: No, hits=0.0 required=10.0tests=FROM_HAS_ULINE_NUMS
X-Spam-Check-By: apache.org
Message-ID: <[EMAIL PROTECTED]>
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.3416
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
X-Virus-Checked: Checked
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 13 Jul 2004 15:13:17.0305 (UTC) FILETIME=[ECD2AE90:01C468EB]


Hello all,

I had a friend ask me on the phone a couple days ago, and now a question
has popped up at javaranch. I've looked in the docs and googled, but
haven't found a definitive 'no' answer (shouldn't life be that simple?).
Thought I'd ask here.

Is there such a thing as directory aliasing / virtual directories (like
you get in Apache), available in Tomcat?

so you'd specify that /images is *really* over here at
/usr/local/some/funky/place/images

I like to tell people they don't need Apache, unless they're doing
"special" stuff.  Would this be one of those "special" things ?




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to