From users-return-207161-apmail-tomcat-users-archive=tomcat.apache.org@tomcat.apache.org Wed Jan 20 14:38:01 2010 Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 17079 invoked from network); 20 Jan 2010 14:38:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Jan 2010 14:38:00 -0000 Received: (qmail 43830 invoked by uid 500); 20 Jan 2010 14:37:57 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 43758 invoked by uid 500); 20 Jan 2010 14:37:57 -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 43747 invoked by uid 99); 20 Jan 2010 14:37:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jan 2010 14:37:56 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aw@ice-sa.com designates 212.85.38.228 as permitted sender) Received: from [212.85.38.228] (HELO tor.combios.es) (212.85.38.228) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Jan 2010 14:37:47 +0000 Received: from localhost (localhost [127.0.0.1]) by tor.combios.es (Postfix) with ESMTP id 6126A2260B2 for ; Wed, 20 Jan 2010 15:37:26 +0100 (CET) Received: from tor.combios.es ([127.0.0.1]) by localhost (tor.combios.es [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rq1yRjalwm-4 for ; Wed, 20 Jan 2010 15:37:26 +0100 (CET) Received: from [192.168.245.129] (p549EAAF1.dip0.t-ipconnect.de [84.158.170.241]) by tor.combios.es (Postfix) with ESMTPA id 14F352260AD for ; Wed, 20 Jan 2010 15:37:25 +0100 (CET) Message-ID: <4B57151C.3010907@ice-sa.com> Date: Wed, 20 Jan 2010 15:37:16 +0100 From: =?ISO-8859-1?Q?Andr=E9_Warnier?= Reply-To: Tomcat Users List User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: multiple URI References: <162835.96977.qm@web36805.mail.mud.yahoo.com> In-Reply-To: <162835.96977.qm@web36805.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Vadym Chepkov wrote: > Unfortunately, I have to install such application in ROOT context for this to work and I am trying to avoid it. > I think Chuck pointed you to one way of achieving this, using the UrlRewriteFilter module (www.tuckey.org). That is a third-party Tomcat add-on module (free) which functions as a servlet filter (meaning it works on any servlet engine, not only Tomcat), and fills a role similar to the Apache httpd mod_rewrite module. Basically, the filter catches a request early (before the servlets see it), examines it, and according to configurable parameters, rewrites the URL and forwards it to another webapp (or not). Unfortunately, I don't know enough myself to show you exactly how to set this up, but my guess would be something like : - suppose for now that you set up your webapp (the one you wish to use to handle requests to /A or /B), under tomcat/webapps/xyz - then in the web.xml of the existing ROOT application, add the configuration for the UrlRewriteFilter. You want it to check the URL for requests to either /A/* or /B/*, and if it matches, then rewrite the URL to /xyz/A/* or /xyz/B/* (for instance) and re-direct this request to your webapp. If it does not match, then you do nothing (and let the request filter down to the normal ROOT app). - now comes the tricky bit of which I am not sure : how do you set up your webapp/servlet, so that it will process these /xyz/* URLs, as re-directed by the filter, and without itself receiving the requests for /xyz directly ? I believe for that you have to set it up somewhere else than under /tomcat/webapps, and then tell Tomcat, separately, where to find it. But that's where my knowledge ends and someone else should take over. Of course you have to set up your webapp to handle the URLs /xyz/A* and /xyz/B*. But the previous post showed you how to do that. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org