Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 57293 invoked from network); 25 Apr 2005 18:03:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Apr 2005 18:03:35 -0000 Received: (qmail 26614 invoked by uid 500); 25 Apr 2005 18:03:43 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 26356 invoked by uid 500); 25 Apr 2005 18:03:42 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 26343 invoked by uid 99); 25 Apr 2005 18:03:42 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of funkman@joedog.org designates 204.74.20.252 as permitted sender) Received: from sid.armstrong.com (HELO sid.armstrong.com) (204.74.20.252) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 25 Apr 2005 11:03:42 -0700 Received: from [10.38.20.246] (tafunk-lt.americas.armstrong.com [10.38.20.246]) by sid.armstrong.com (8.12.8p1/8.12.8) with ESMTP id j3PHvnEJ024173 for ; Mon, 25 Apr 2005 12:57:49 -0500 Message-ID: <426D30DB.50601@joedog.org> Date: Mon, 25 Apr 2005 14:03:07 -0400 From: Tim Funk Organization: Human being User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en, es-mx, de, sv MIME-Version: 1.0 To: Tomcat Users List Subject: Re: context path question References: <883e185905042510406611c69c@mail.gmail.com> In-Reply-To: <883e185905042510406611c69c@mail.gmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Use HttpServeletRequest.getContextPath() to get the context path. -Tim Daniel Watrous wrote: > Hello, > > I am have written some filters for a shopcart application. I intend > for parts of this applicaiton to be reused in other web applications > by including it as a JAR file. > > For authentication I have the file AdministratorAuthFilter, which > checks for a session value indicating that the user has logged in. > The trouble comes with the following line: > > response.sendRedirect("/simplecart/AdministratorLogin.do"); > > My development application is simplecart and so when I deploy to > tomcat I have a URL like "http://localhost:8080/simplecart/" which > serves as my root. If I include this filter in another application as > part of a JAR that application will end up with another root, such as > "http://localhost:8080/mycart/". So the line above in my filter that > includes the literal "simplecart" breaks. > > I have searched for something related to the context or context path. > All suggestions appreciated. > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org