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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to