Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CBA48200BA0 for ; Fri, 14 Oct 2016 09:25:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CA2DC160ADD; Fri, 14 Oct 2016 07:25:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1C74C160AD9 for ; Fri, 14 Oct 2016 09:25:09 +0200 (CEST) Received: (qmail 11775 invoked by uid 500); 14 Oct 2016 07:25:08 -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 11760 invoked by uid 99); 14 Oct 2016 07:25:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Oct 2016 07:25:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 73EF01A0466 for ; Fri, 14 Oct 2016 07:25:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=6.31 tests=[SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id fBs37_Nsv12t for ; Fri, 14 Oct 2016 07:25:05 +0000 (UTC) Received: from thor.wissensbank.com (thor.wissensbank.com [81.169.250.120]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 0AC945F5D3 for ; Fri, 14 Oct 2016 07:25:04 +0000 (UTC) Received: from thor.wissensbank.com (localhost [127.0.0.1]) by thor.wissensbank.com (Postfix) with ESMTP id C568215A60748 for ; Fri, 14 Oct 2016 09:25:01 +0200 (CEST) Received: by thor.wissensbank.com (Postfix, from userid 500) id A348115A61087; Fri, 14 Oct 2016 09:25:01 +0200 (CEST) Received: from [192.168.2.206] (stargate.glomas.de [213.23.110.130]) (Authenticated sender: andre.warnier@ice-sa.com) by thor.wissensbank.com (Postfix) with ESMTPA id 44BA515A60748 for ; Fri, 14 Oct 2016 09:25:01 +0200 (CEST) Subject: Re: how to write a valve To: users@tomcat.apache.org References: From: =?UTF-8?Q?Andr=c3=a9_Warnier_=28tomcat=29?= Message-ID: <58008847.8030203@ice-sa.com> Date: Fri, 14 Oct 2016 09:24:55 +0200 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP archived-at: Fri, 14 Oct 2016 07:25:11 -0000 On 13.10.2016 17:04, Campbell, Lance wrote: > Tomcat 8.0.38 > > In my Eclipse development environment when particular servlet requests are made I want to simulate going through Shibboleth prior to Tomcat handling the request. I wanted to see if this will work. > > In Eclipse within each dynamic web application I would add a valve to the context.xml file. > > The valve would: > > 1) Check the URL request. > > 2) If the URL string matches a list then it will add particular name value pairs to the request. > > Example of a possible valve: > > > > > 1) Can a valve actually identify a particular URL path? > > 2) Can a valve add an attribute to the request prior to the servlet getting the request? > > 3) If item #1 and #2 will work does anyone have some base code for a value that would get me started down the correct path? > Hi. I think the best thing here is to point you to Google. If you search for "HttpServletRequest immutable", you'll get a whole bunch of useful links. There is also example code there. The basic thing here, is that the HttpServletRequest object that you get originally, is *immutable* (can't be modified, for example to add a header or add additional parameters). So you have to "wrap" it with a HttpServletRequestWrapper, and then override some of the standard methods in that wrapper. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org