Or, to abstract one step further, just have a "url" tag:

<img src="<taglib:url url="/images/foo.gif"/>">
<a href="<taglib:url url="/index.html"/>">

webwork has a tag that does exactly this. It's also a very nice 
framework... check it out.

-Pat

At 08:39 AM 7/20/2001 -0700, elephantwalker wrote:
>Another solution is to create a usr tld/tag for  img
>
><user:img src="/images/logo.gif" />
>
>regards,
>
>the elephantwalker
>
>
>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED]]On Behalf Of Brian Thompson
>Sent: Friday, July 20, 2001 8:02 AM
>To: Orion-Interest
>Subject: best way to build a link to work in different deployment
>configurations??.
>
>
>I have an application that during development is deployed multiple times
>with the following...
>         http://devwebsite/customerApp1
>         http://devwebsite/customerApp2
>
>In production, I'd like to deploy the applications as...
>         http://customerApp1
>         http://customerApp2
>
>In the first case file references would look like the following
>         <img src="/customerApp1/images/logo.gif">
>while in the second case it should be
>         <img src="/images/logo.gif">
>
>My question is what is the best way to handle file references (links,
>images, etc) within the application to support both deployments. We could
>use the request.getContextPath() as a prefix to all file references
>         <img src="<%=request.getContextPath()%>/images/logo.gif">
>but to do this across an entire application seems like extra overhead. It
>seems like there should be a more elegant solution. I've scoured the orion
>doc to see if there is a way to do this through configuring websites and
>webapps, but with no success. Has anyone discovered a better way??
>
>Thanks.


Reply via email to