Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 36476 invoked from network); 3 Mar 2008 16:59:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Mar 2008 16:59:05 -0000 Received: (qmail 28040 invoked by uid 500); 3 Mar 2008 16:58:50 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 28014 invoked by uid 500); 3 Mar 2008 16:58:49 -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 28003 invoked by uid 99); 3 Mar 2008 16:58:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2008 08:58:49 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2008 16:58:14 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1JWDzb-0005Gv-Rg for users@tomcat.apache.org; Mon, 03 Mar 2008 08:58:23 -0800 Message-ID: <15808317.post@talk.nabble.com> Date: Mon, 3 Mar 2008 08:58:23 -0800 (PST) From: ciAnd7 To: users@tomcat.apache.org Subject: Request.getContextPath() after RequestDispatcher.forward() MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: cindrhc@gmail.com X-Virus-Checked: Checked by ClamAV on apache.org Hi! I am using tomcat 6.0.13 on linux. I try to deploy my application in to the root context. I.e. it should be available as root application on one of virtual host (http://vhost1/). So, I add into the server.xml (I know, it is not recommended to do it in server.xml, but it is simple and I just want to do simple testing right now). The application works fine. But there is a problem with request.getContextPath() method. My Servlets use RequestDispatcher.forward() to JSP. And then, JSP use Request.getContextPath() to generate URLs (more precisely, getContextPath() used by JSTL`s implementation). But getContextPath() returns "/", so urls generated by looks like "//image/blah.gif" - i.e. they have double leading slashes. As result - browser can`t process urls correctly. As I understand specification, getContextPath() should returns empty string in such case... (And JSTL`s implementation of expects such behavior). If I deploy application under "ordinal" context path, all works correctly (getContextPath() returns string like "/myapp"). If my Servlet use RD.include() instead of forward(), all works fine: getContextPath() returns empty string. Could somebody help me with solution. Thanks. -- View this message in context: http://www.nabble.com/Request.getContextPath%28%29-after-RequestDispatcher.forward%28%29-tp15808317p15808317.html Sent from the Tomcat - User mailing list archive at Nabble.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