Using the BASE tag means that you only need to change that one single value - all the other URLs in your pages would stay fixed, because they are relative to the BASE tag.
So, for example, you could have a common tag library that sets the BASE tag value dynamically for all your pages - IOW, one tag library services all your pages. As for altering the code between development and deployment, the solutions to that are trivial: if you are rebuilding between development and deployment, then use a different build property to set a runtime property that your tag library references. If you're using the same build, then have a runtime variable that you can set, which you tag library references. I've used this method, and I recommend it. It's simple, and portable. Harry Mantheakis > Thanks for all your information. > > I was thinking of a application configuration solution so that I don't need > to alter the code between development and deployment. I have several > applications in various development phases in my box. I try to figure to > handle them together. > > > Vernon > __________________________________________________________ > http://www.vicina.info > > > ----Original Message Follows---- > From: Harry <[EMAIL PROTECTED]> > Reply-To: "Tomcat Users List" <users@tomcat.apache.org> > To: Tomcat Users List <users@tomcat.apache.org> > Subject: Re: Application Path > Date: Tue, 07 Nov 2006 09:31:27 +0000 > MIME-Version: 1.0 > Received: from mail.apache.org ([140.211.11.2]) by > bay0-mc9-f5.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2444); Tue, 7 > Nov 2006 01:31:58 -0800 > Received: (qmail 18223 invoked by uid 500); 7 Nov 2006 09:32:06 -0000 > Received: (qmail 18212 invoked by uid 99); 7 Nov 2006 09:32:06 -0000 > Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) > by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 01:32:06 -0800 > Received: neutral (herse.apache.org: local policy) > Received: from [80.168.70.142] (HELO relay2.mail.uk.clara.net) > (80.168.70.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 > 01:31:51 -0800 > Received: from mantheakis.claranet.co.uk ([80.168.130.24] helo=[10.0.0.3])by > relay2.mail.uk.clara.net with esmtp (Exim 4.50)id 1GhNIn-0007na-7mfor > users@tomcat.apache.org; Tue, 07 Nov 2006 09:31:29 +0000 > X-Message-Info: txF49lGdW42h0cbO+nEGCm+Gy+i+Lt7qOV5pel0LBy8= > Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm > Precedence: bulk > List-Help: <mailto:[EMAIL PROTECTED]> > List-Unsubscribe: <mailto:[EMAIL PROTECTED]> > List-Post: <mailto:users@tomcat.apache.org> > List-Id: <users.tomcat.apache.org> > Delivered-To: mailing list users@tomcat.apache.org > X-ASF-Spam-Status: No, hits=0.5 required=10.0tests=DNS_FROM_RFC_ABUSE > X-Spam-Check-By: apache.org > User-Agent: Microsoft-Entourage/10.1.6.040913.0 > X-Virus-Checked: Checked by ClamAV on apache.org > Return-Path: [EMAIL PROTECTED] > X-OriginalArrivalTime: 07 Nov 2006 09:31:58.0422 (UTC) > FILETIME=[92575F60:01C7024F] > > Alternatively, you can set a BASE reference within the HEAD element of each > page, and then use relative-paths in all your URLs: > > > <head> > ... > <base href="http://www.webadorable.com/your-app-context-name-here/"/> > ... > </head> > > ... > > <img src="relpath/to/image.jpg"/> > > > The BASE value can (should!) be set dynamically, of course - with a tag > library, or whatever. > > Notice that the BASE reference has a trailing slash, whilst your relative > paths must start without a leading slash. > > Harry Mantheakis > > >> Is there any reason you can't just have the paths composed dynamically?: >> >> <img src="${pageContext.request.contextPath}/webapp/relpath/to/image.jpg" > /> >> >> For the ROOT webapp, the expression will return an empty path, so it's >> always correct. >> >> --David >> >> Vernon _ wrote: >>> >>> I have another new application deployed in a non-root directory. I >>> need to have absolute paths for CSS and Javascript in order to import >>> them properly with differenct level structure of JSP files. I can >>> deploy it as the root application or add the application name in the >>> absolute path. Neither solutions are very good. Any good practise to >>> solve this issue? >>> >>> Thanks, >>> >>> Vernon >>> >>> _________________________________________________________________ >>> Find a local pizza place, music store, museum and moreĀthen map the >>> best route! http://local.live.com?FORM=MGA001 >>> >>> >>> --------------------------------------------------------------------- >>> To start a new topic, e-mail: users@tomcat.apache.org >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >> >> >> --------------------------------------------------------------------- >> To start a new topic, e-mail: users@tomcat.apache.org >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > _________________________________________________________________ > Stay in touch with old friends and meet new ones with Windows Live Spaces > http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://space > s.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us > > --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]