Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 20680 invoked from network); 17 Sep 2009 16:51:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Sep 2009 16:51:14 -0000 Received: (qmail 63545 invoked by uid 500); 17 Sep 2009 16:51:10 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 63467 invoked by uid 500); 17 Sep 2009 16:51:10 -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 63456 invoked by uid 99); 17 Sep 2009 16:51:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Sep 2009 16:51:10 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [76.96.62.64] (HELO QMTA07.westchester.pa.mail.comcast.net) (76.96.62.64) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Sep 2009 16:50:58 +0000 Received: from OMTA04.westchester.pa.mail.comcast.net ([76.96.62.35]) by QMTA07.westchester.pa.mail.comcast.net with comcast id hs1c1c00E0ldTLk57sqeoh; Thu, 17 Sep 2009 16:50:38 +0000 Received: from [192.168.1.200] ([69.143.128.194]) by OMTA04.westchester.pa.mail.comcast.net with comcast id hsqd1c00B4BnRt93QsqeN1; Thu, 17 Sep 2009 16:50:38 +0000 Message-ID: <4AB268DC.5030501@christopherschultz.net> Date: Thu, 17 Sep 2009 12:50:36 -0400 From: Christopher Schultz User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.1) Gecko/20090715 Thunderbird/3.0b3 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: tomcat & url rewrite References: <25395691.post@talk.nabble.com> <25429315.post@talk.nabble.com> <4AAE5067.8060800@christopherschultz.net> <25446546.post@talk.nabble.com> <4AAFD00D.1030701@christopherschultz.net> <25464594.post@talk.nabble.com> <4AB1524C.2080703@christopherschultz.net> <25483993.post@talk.nabble.com> In-Reply-To: <25483993.post@talk.nabble.com> X-Enigmail-Version: 0.96a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 William, On 9/16/2009 10:04 PM, WILLIAMer wrote: > Let me say sorry for i didnt description the error. > The error like the path is mapping incorrectly. So, what error message do you get? > So the image or css are not display because of the path not find. Hmm... > A part of my application structure like under > /tomcat/webapps/myApp/images > /css > /Admin/index.jsp > /index.jsp > > I set my application to be ROOT. > The url http://myDomain/ will go my application instead of > http://myDomain/myApp. > > Why i say http://myDomain/item_pd12/34.html let me confuse? > Because i didnt have the directory named item_pd12. Oh, that will certainly be a problem. This is one of the hazards of playing games with your URLs: if you use relative URLs for static content, things break when you change the base URL of the web page. The solution? Always use fully-qualified URLs (see HttpServletResponse.encodeURL and request.getContextPath). > In my jsp code, i really write some code for image or css path. > Something like <%String sImagePath = "/myApp/images";%>. > > For this case http://myDomain/item_pd12/34.html. > I guess tomcat will to find the directory named item_pd12 under /myApp dir > and didnt find my images though the sImagePath. If you always start your URLs with a '/', then you shouldn't have a problem. > Another question, after i touch http://myDomain/item_pd12/34.html, > link other page would stuck with http://myDomain/item_pd12/otherPage. > But the really url i want would like http://myDomain/otherPage. Then write your URLs properly, starting with a '/'. > Maybe i need to improve my code though something like relative path instead > of absolute path. No, you need an absolute path instead of a relative path. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkqyaNwACgkQ9CaO5/Lv0PBf3gCdHS61t5JZg2ZSjDXBQ5HxKI3N 5WAAni4/4yAaydwW41EOZ149jmFp6+XG =5jHd -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org