You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Struts Newsgroup (@Basebeans.com)" <st...@basebeans.com> on 2002/03/26 20:10:02 UTC

and servlet context - doesn't get it

Subject: <html:img> and servlet context - doesn't get it
From: "Matt Raible" <ma...@icsynergy.com>
 ===
I am having a problem in my webapp.

I setup the mapping to my images directory in my struts-config.xml as
follows:

<forward name="images" path="/images"/>

This works great, as I then write my images as follows:

    <img src="<html:rewrite forward='images'/>/logoOnpoint.gif"
class="logo"/>

The <html:rewrite> adds {context}/images to the src attribute.

However, when I hit my welcome page for the first time, the src is resolved
as:

/onpoint/images;jsessionid=1514B06821426587237517B89374C181/logoOnpoint.gif

I attempted to fix this by using the html:img tag

<html:img src="/images/logoOnpoint.gif"> thinking that this would resolve to
the proper src with the context pre-pended.  No Dice.

Any ideas?

I took out the html:base tag since it was resolving to my tiles template,
rather than the actual request URL.

Thanks,

Matt






--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: and servlet context - doesn't get it

Posted by Max Cooper <ma...@maxcooper.com>.
Use the page attribute instead of src to have the context path prepended:

<html:img page="/images/logoOnpoint.gif">

-Max

----- Original Message -----
From: "Struts Newsgroup" <@B...@basebeans.com>
To: <st...@jakarta.apache.org>
Sent: Tuesday, March 26, 2002 11:10 AM
Subject: <html:img> and servlet context - doesn't get it


> Subject: <html:img> and servlet context - doesn't get it
> From: "Matt Raible" <ma...@icsynergy.com>
>  ===
> I am having a problem in my webapp.
>
> I setup the mapping to my images directory in my struts-config.xml as
> follows:
>
> <forward name="images" path="/images"/>
>
> This works great, as I then write my images as follows:
>
>     <img src="<html:rewrite forward='images'/>/logoOnpoint.gif"
> class="logo"/>
>
> The <html:rewrite> adds {context}/images to the src attribute.
>
> However, when I hit my welcome page for the first time, the src is
resolved
> as:
>
>
/onpoint/images;jsessionid=1514B06821426587237517B89374C181/logoOnpoint.gif
>
> I attempted to fix this by using the html:img tag
>
> <html:img src="/images/logoOnpoint.gif"> thinking that this would resolve
to
> the proper src with the context pre-pended.  No Dice.
>
> Any ideas?
>
> I took out the html:base tag since it was resolving to my tiles template,
> rather than the actual request URL.
>
> Thanks,
>
> Matt
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>