Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 4718 invoked from network); 16 Sep 2009 16:35:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Sep 2009 16:35:31 -0000 Received: (qmail 12281 invoked by uid 500); 16 Sep 2009 16:35:27 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 12227 invoked by uid 500); 16 Sep 2009 16:35:27 -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 12216 invoked by uid 99); 16 Sep 2009 16:35:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Sep 2009 16:35:27 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_HELO_PASS,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.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; Wed, 16 Sep 2009 16:35:16 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MnxT5-0001Fc-Kt for users@tomcat.apache.org; Wed, 16 Sep 2009 09:34:55 -0700 Message-ID: <25476023.post@talk.nabble.com> Date: Wed, 16 Sep 2009 09:34:55 -0700 (PDT) From: Alexeiych To: users@tomcat.apache.org Subject: Re: Path In-Reply-To: <20900779.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: alexeiych@gmail.com References: <20899470.post@talk.nabble.com> <493D5764.8000001@cornell.edu> <20899908.post@talk.nabble.com> <493D5D56.5030009@cornell.edu> <20900779.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org I have similar problem. However since I use JSF all my links and references are defined in faces-config.xml file. ${pageContext.request.contextPath} is not very clean solution since one definitely do not want this statements across all JSPs, Servlets, config files, etc. For example in Oracle App Server you can configure such behavior in /config/http-web-site.xml. Is there any way to configure Tomcat so that it treats http://localhost:8888/myApp/ as a root context for building absolute paths within myApp? Thanks, Alexey. coubeatczech wrote: > > > David Smith-2 wrote: >> >> >> No need to edit any *.xml files. >> >> Your webapp already knows what it's context path is when the request >> comes in. The expression I wrote is used in jsp pages to compose server >> absolute links to resources like jsps, html pages, images, javascript, >> css, etc., ... Consider it in the context of: >> >> ${pageContext.request.contextPath}/jsp/any.jsp Click here to >> (whatever) >> >> If you are working with a servlet instead of a jsp, it would be >> request.getContextPath() + "/jsp/any.jsp" to build links where request >> is an instance of javax.servlet.http.HttpServletRequest. >> >> --David >> >> > > Great, thanks, it answered my question, it works now and I'm almost > absolutely happy. :-) > -- View this message in context: http://www.nabble.com/Path-tp20899470p25476023.html Sent from the Tomcat - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org