Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 70308 invoked from network); 5 Jul 2006 15:47:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Jul 2006 15:47:35 -0000 Received: (qmail 57011 invoked by uid 500); 5 Jul 2006 15:47:22 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 56993 invoked by uid 500); 5 Jul 2006 15:47:22 -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 56982 invoked by uid 99); 5 Jul 2006 15:47:22 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jul 2006 08:47:22 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [128.253.83.141] (HELO authusersmtp.mail.cornell.edu) (128.253.83.141) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jul 2006 08:47:21 -0700 Received: from [128.253.38.244] (defiant.ento.cornell.edu [128.253.38.244]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.13.1/8.12.10) with ESMTP id k65Fl06g016446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 5 Jul 2006 11:47:00 -0400 (EDT) Message-ID: <44ABDEF4.30408@cornell.edu> Date: Wed, 05 Jul 2006 11:47:00 -0400 From: David Smith User-Agent: Mozilla Thunderbird 1.0.6 (Macintosh/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Serving CSS files from a certain URL References: <20060705145337.29768.qmail@web35413.mail.mud.yahoo.com> In-Reply-To: <20060705145337.29768.qmail@web35413.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N In your Test.jsp, why don't you have something similar to: I'm of course assuming tomcat 5.x.x and the web.xml file is declared for servlet spec 2.4. This should work whether the running tomcat instance is on your local machine or the production server. --David Alec Swan wrote: >Web designers don't run web servers or servlet containers on their machines. (I call their environment "static"). They just create web pages using Dreamweaver and preview them in different browsers. So, in my running example Test.jsp would have the following relative link ../../css/Styles.css in order for it to work in the "static" environment. > >However, this relative link doesn't work when I deploy Test.jsp in Tomcat. Suppose I deploy my web-app under /testapp context. In this case, Test.jsp would have to link to the css file through one of the following links: >../testapp/css/Styles.css or >/css/Styles.css >Neither of which work in the "static" environment used by web designers. > >I hope this elucidates the problem a little further. So, the question persists, what is the right way to get links to CSS files to work in static as well as deployed environment? > >Thanks. > >Hassan Schroeder wrote: On 7/4/06, Alec Swan wrote: > > > >>I need to reference Styles.css from Test.jsp in such a way that it works in static as well as in deployed mode. Note that for this to work in the static mode (no web servers or servlet containers) all paths should be relative. Therefore, when I deploy Test.jsp I want Tomcat either to handle relative paths correctly or ignore the path altogether and just serve all CSS file from a certain location (directory or URL). >> >>The goal of all this is to maintain only one source tree used by web designers and Tomcat administrator and avoid changing paths in JSP files during deployment. >> >>I would appreciate any feedback on this. >> >> > >OK, since you asked :-) -- this seems a really strange requirement; >are your "web designers" unable to run a Tomcat instance to work >in? > >But in any case, using relative links to a css file works fine on a test >page I just did that mirrors your described files. So *exactly* how is >this not working for you? > > > --------------------------------------------------------------------- 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