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 5B5E1200D1E for ; Wed, 4 Oct 2017 02:44:43 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 59BBA160BD5; Wed, 4 Oct 2017 00:44:43 +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 9EC6E1609DE for ; Wed, 4 Oct 2017 02:44:42 +0200 (CEST) Received: (qmail 22353 invoked by uid 500); 4 Oct 2017 00:44:40 -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 22342 invoked by uid 99); 4 Oct 2017 00:44:40 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Oct 2017 00:44:40 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 60B41DC8B2 for ; Wed, 4 Oct 2017 00:44:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.999 X-Spam-Level: X-Spam-Status: No, score=0.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, SPF_HELO_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id dLbZuu4OiRiJ for ; Wed, 4 Oct 2017 00:44:36 +0000 (UTC) Received: from mailbox.servedge.com (li1281-212.members.linode.com [45.79.182.212]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 5B0D35F1E7 for ; Wed, 4 Oct 2017 00:44:36 +0000 (UTC) Received: (qmail 20116 invoked by uid 513); 3 Oct 2017 19:44:36 -0500 Received: from pool-173-66-116-184.washdc.fios.verizon.net (HELO Christophers-iMac.local) (chris@christopherschultz.net@173.66.116.184) by mailbox.servedge.com with ECDHE-RSA-AES128-GCM-SHA256 encrypted SMTP; 3 Oct 2017 19:44:36 -0500 Subject: Re: encodeURL, jsessionid and mod_rewrite ? To: users@tomcat.apache.org References: From: Christopher Schultz Message-ID: <6e827382-25c7-0be0-a62b-40a6a9fd40e6@christopherschultz.net> Date: Tue, 3 Oct 2017 20:44:35 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit archived-at: Wed, 04 Oct 2017 00:44:43 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Laurant, On 10/3/17 5:17 PM, Laurent Perez wrote: > I'm using apache+mod_proxy+mod_rewrite as a tomcat frontend. A > "foo" war is deployed at /foo context path under tomcat. The /foo > path is not public, apache has a rewrite rule defined as : /bar/* > rewrites internally to /foo/*. > > I'm using jstl and its for every url in my > jsps to gain the ;jsessionid from encodeURL whenever jsessionid > cookie is not yet set (1st requests) > > Now my question is : the results in a > "/foo/page.jsp;jsessionid=..." I want the result instead as > /bar/pages.jsp;jsessionid=.... > > Should I go straight for a HttpServletResponseWrapper replacing > every /foo/ with /bar/ or is there a more elegant way ? If the > apache rewrite rule is modified - say, to /barv2/, is it ok to use > mod_headers to pass the original path instead of hardcoding /bar/ > ? You are going down a path that will produce endless problems, hacks, and ugly solutions to those problems. It will be much easier for you to simply re-name your application from "foo" to "bar" and not worry about any of this rewriting foolishness. - -chris -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQJRBAEBCAA7FiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlnULvMdHGNocmlzQGNo cmlzdG9waGVyc2NodWx0ei5uZXQACgkQHPApP6U8pFjrIw//fPYMRXFyX4Ad4Qcl f6H2XjoFU7zOH9sQXjj5KgDL+DWS2nMH20RWes74ehYNv3BGDLIsv4CHClessOhW f7euy0y18IAhnTGjUaP3WjbN6xt2M6UgWsIv2jxS30DdI6irZ8/9IWdZ4xy8PNWV OujeuQBWniQH6jPVUwQ17qapiBDbAzB58HXb72KYFDj+Z6C0gacK/MT9yTkiNEX/ bFNucLH2oTMomRcNeGZsmWCmQ+jShx0bMjmaKX5JndtckRCWSG8bAZYBhq5JA+bd GlFk/jZl+PT0cO1q6ViHvv9r3DDIUAMXvfvQnf6RciQ86GB+GrJn/GnRtPo7R5RH MoNRr7H16XBXER1SlzjXHLd2HOKf5pFduG1lgwY1z4OWKdqHY39/bSJynfCjyiNC VAvlZZQ2tCudwa+7Pit85FryW4HWECvw10vwYNLHDfFD63juI6YexaN+Fd5RGu8R jGqN3GqR1iboveGTv8O2kSvTgJjGa0nxsd6CTZLMJXt1GPlZ4r9MRdZWO/dobvGt QV18dvwHYHo1Jsgo1+pR6Hw34hw0dPfD5IYiHV9k+9yIeWj3l4/tYu+k1VA9j/Yp /LJ6otvJ+zBaa2swroy+EnnbMP6JR04GnXrezglXxbndaP1l7POCFngH34veM4+S j/5ZMvfJiUZdDAdQxoFH6B9ochU= =0zb2 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org