Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E3CF842B1 for ; Wed, 8 Jun 2011 15:22:22 +0000 (UTC) Received: (qmail 54493 invoked by uid 500); 8 Jun 2011 15:22:19 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 54373 invoked by uid 500); 8 Jun 2011 15:22:19 -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 54364 invoked by uid 99); 8 Jun 2011 15:22:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jun 2011 15:22:19 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of FAlvarez@geocom.com.uy designates 200.40.252.211 as permitted sender) Received: from [200.40.252.211] (HELO GeoMlExc.geocomuy.local) (200.40.252.211) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jun 2011 15:22:14 +0000 Received: from FAlvarezHP (192.168.245.133) by GeoMlExc.geocomuy.local (192.168.250.90) with Microsoft SMTP Server id 14.0.722.0; Wed, 8 Jun 2011 12:21:49 -0300 From: To: 'Tomcat Users List' References: <00e001cc25e6$bd643ab0$382cb010$@com.uy> In-Reply-To: Subject: RE: Static resource mapping in web.xml Date: Wed, 8 Jun 2011 12:25:14 -0300 Message-ID: <00f801cc25f0$43faf240$cbf0d6c0$@com.uy> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acwl6vIGKXVITf+bRUKyVrbCD3N26gAAwn5Q Content-Language: es-uy Interesting Tim. But a little confusing for me. Never used filters, but for what you said and I googled: I would have to build a filter and map it to "/images/*", right? Something like: Resource filter com.mycompany.resourcefilter Resource filter mapped /images/* If I understand correctly, every request made to this URL path will be answerd with what I declare in the filter. Am I in the correct way? -----Mensaje original----- De: Tim Funk [mailto:funkman@apache.org]=20 Enviado el: mi=E9rcoles, 08 de junio de 2011 11:47 Para: Tomcat Users List Asunto: Re: Static resource mapping in web.xml Your "easiest" workaround is to use a filter. So 1) have the default servlet map to /* (which is the default) 2) keep the invoker declared 3) And make your filter do this ... doFilter(..) { if (request.getServletPath().matches(regex-here)) { = servletContext.getNamedDispatcher("invoker").forward(request,response); return; } chain.doFilter(...) } Where regex-here is something which limits the mayhem you are imposing = on yourself .. like this: "/servlet/com\.yourcompany\..+" -Tim On 6/8/2011 10:17 AM, falvarez@geocom.com.uy wrote: Dear all, I'm faceing the following problem in tomcat (probably = just configuration). I have a WEBAPP which uses the "invoker" servlet (i know = how bad it is, but for now it gets the job done). The static content is under "/images/" path. So a tipical URL was like"http://host:8080/webapp/servlet/home" . To avoid the "servlet" part of the URL I layed hands in "web.xml". This is the result: invoker = /* default /images/* The problem is that static content is not shown under "images", it is shown under "images/images". For example: http://host:8080/webapp/images/help.png ERROR http://host:8080/webapp/images/images/help.png OK In order to keep things as tidy as possible I would like static content to be served under "images". Using ROOT is not an option because this tomcat is = shared among several WEBAPPS. Is there anything wrong with my configuration or am I missing something? This post addresses the same issue: =20 http://stackoverflow.com/questions/234210/can-anyone-explain-servlet-mapp= ing Thanks in advance and please excuse my bad English. Best regards, Federico. OS CentOS 5 Tomcat 6.0.29 JVM 1.6.0_20-b02 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org