Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 71150 invoked from network); 1 Aug 2008 22:49:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Aug 2008 22:49:29 -0000 Received: (qmail 92031 invoked by uid 500); 1 Aug 2008 22:49:16 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 92002 invoked by uid 500); 1 Aug 2008 22:49:16 -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 91990 invoked by uid 99); 1 Aug 2008 22:49:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2008 15:49:16 -0700 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 hassan.schroeder@gmail.com designates 209.85.132.240 as permitted sender) Received: from [209.85.132.240] (HELO an-out-0708.google.com) (209.85.132.240) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2008 22:48:21 +0000 Received: by an-out-0708.google.com with SMTP id b36so247357ana.95 for ; Fri, 01 Aug 2008 15:48:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=YYpSmmKLzeWv/a//a+ypVOjzgmyeqVq+CWNDzbQoDQQ=; b=pf+FA2T8cflT7+f767W1sgTzvrA768Tu5MU2AJNSIm5WQhMRJIOvbT6T1USDqpq/8d TSZX1JL456AS0o1mRbobL1MLf7aquOMDfrh0Qq0AQlmair6nyKd4T3/Qiv5TEtEajkhx k2+WrtGZgrVw3aS11YtwvaiWB1Y66PHKS7Lek= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=xlh+6oJRxwOMIg4xQSKGLPrFcqP6gLWJQ3b1PuPcNfMLr3aaQxc5App4rC6+bb9fJS h/7XqctOcTVH1V2M0pbplxHJBsR/daiRTRBEFaBA80qQy6xZxvJoeS16Etwxvggl8wyY yYrsSUnOPM4Jho6QW5hB7mbsTUcCCrD2JOit4= Received: by 10.100.111.5 with SMTP id j5mr17569334anc.3.1217630910307; Fri, 01 Aug 2008 15:48:30 -0700 (PDT) Received: by 10.100.205.20 with HTTP; Fri, 1 Aug 2008 15:48:30 -0700 (PDT) Message-ID: <4eedb92a0808011548m53a5e26bpa2d628c06d1d579f@mail.gmail.com> Date: Fri, 1 Aug 2008 15:48:30 -0700 From: "Hassan Schroeder" To: "Tomcat Users List" Subject: Re: enabling/disabling a servlet filter conditionally In-Reply-To: <48938E83.6050907@ice-sa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <4893749F.3070701@ice-sa.com> <4eedb92a0808011432w442321cob5056c5091bcaf95@mail.gmail.com> <48938E83.6050907@ice-sa.com> X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Aug 1, 2008 at 3:30 PM, Andr=E9 Warnier wrote: >> You could /probably/ -- untested conjecture -- break the FilterChain at >> that point by forwarding to a URL for which Filter B wasn't applied (or >> was applied only to a REQUEST rather than FORWARD. >> > On second read, can you elaborate on that one ? > Do I understand correctly, as follows ? > b) make filter A, in case it doesn't want filter B to run, change the > request URL to, e.g., "something.abc", yes, with the caveat that "change the request URL" means use a RequestDispatcher to forward the request. The second approach which might be less obtrusive, means to define your Filters so that Filter B is only applied to REQUESTs, e.g. Filter_B /* REQUEST When Filter A sees the condition where Filter B should not be applied, it forwards the request to the original request URL; now Filter B is not part of the FilterChain because it's not a REQUEST. Actually, you could probably do the same with Filter A, since you presumably wouldn't need it to act on the request a second time. Again, untested, but easy enough to try, and you don't need to make any filename/URL-pattern changes as with the first approach. HTH, --=20 Hassan Schroeder ------------------------ hassan.schroeder@gmail.com --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org