Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 66068 invoked from network); 5 Feb 2010 15:18:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Feb 2010 15:18:30 -0000 Received: (qmail 58898 invoked by uid 500); 5 Feb 2010 15:18:26 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 58860 invoked by uid 500); 5 Feb 2010 15:18:26 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 58849 invoked by uid 99); 5 Feb 2010 15:18:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Feb 2010 15:18:26 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of pid@pidster.com does not designate 209.85.212.45 as permitted sender) Received: from [209.85.212.45] (HELO mail-vw0-f45.google.com) (209.85.212.45) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Feb 2010 15:18:18 +0000 Received: by vws15 with SMTP id 15so1021630vws.18 for ; Fri, 05 Feb 2010 07:17:55 -0800 (PST) Received: by 10.220.125.10 with SMTP id w10mr5444424vcr.102.1265383075732; Fri, 05 Feb 2010 07:17:55 -0800 (PST) Received: from Phoenix.local (94-193-98-41.zone7.bethere.co.uk [94.193.98.41]) by mx.google.com with ESMTPS id 37sm12198062vws.7.2010.02.05.07.17.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 05 Feb 2010 07:17:54 -0800 (PST) Message-ID: <4B6C369F.9030000@pidster.com> Date: Fri, 05 Feb 2010 15:17:51 +0000 From: Pid Reply-To: pid@pidster.com Organization: Pidster Inc User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: users@tomcat.apache.org Subject: Re: Web resource By-pass References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 05/02/2010 14:59, Mihalakakos, Demetri wrote: > Hi, > > I have a question about the best way of doing something. > > I'm writing an application where all requests would get routed to a Filter (mapping: "/*"). So when I get a requests like "/some/page/in/the/web/" (which does not actually live in the file system) I would forward to a Servlet or handle appropriately. The problem is all web resources are being routed there as well (js, css, images), is it possible to have all files and folders that do exist on the file system get served normally and not through my Filter. I know I can do a simple io check in the filter, but I was wondering if that's actually the best/only way (one of my concerns is optimization) 1. You could immediately pass through those requests by doing something like: if (matchesStaticFiles(hreq.getRequestURI())) { chain.doFilter(hreq, hres); return; } 2. Or put them in a separate application and refer to them with an absolute URL. p > For example in PHP or Python I would put something like this in the vhost: (which is technically happening out side the application) > RewriteCond %{REQUEST_FILENAME} !-f > RewriteCond %{REQUEST_FILENAME} !-d > RewriteRule ^(.*)$ /index.php [L] > > Also I prefer not use 'Apache httpd' with 'tomcat' > > Thank you > Demetri > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org