I ran into this same issue. I accomplished this by
creating a custom tag (in my case called, PageLoader).
The PageLoader tag will expose a scripting variable
called contextRoot, which is basically
pageContext.getRequest()).getContextPath()
scott.
--- Nathan Coast <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've got an app that will be deployed to a number of
> different contexts
>
> /test
> /dev
> /staging
> /
> (root)
>
> The app contains a large amount of static content
> e.g. images which will always
> be referenced from "/current_context/image"
>
> some of the jsps are accessed directly and via the
> action servlet - sometimes
> with different depths for the action url e.g.
>
/current_context/something/something_else/my_action.do
> /current_context/something/another_action.do
> /somepage.jsp
>
> this obviously rules out using relative urls for the
> static content but the
> changing contexts makes it difficult for basing the
> urls on root.
>
> Is the solution to precede the url to every image in
> every jsp with a variable
> containing the value of the context? Is this not a
> performance hit? What's the
> best way to do it? Is there a struts tag that does
> this for me? How do I achieve
> world peace? - oops wrong mail list.
>
> Thanks
> Nathan
>
=====
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Scott
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/