how about a regular HTML image tag like this:

<img src="<%= request.getContextPath()%>/images/yourImage.gif">

Sincerely,

Shane Witbeck
______________________________________
Developer, Bank of America
email: [EMAIL PROTECTED]
phone: 904.987.1688

-----Original Message-----
From: Struts Newsgroup [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 2:10 PM
To: [EMAIL PROTECTED]
Subject: <html:img> and servlet context - doesn't get it


Subject: <html:img> and servlet context - doesn't get it
From: "Matt Raible" <[EMAIL PROTECTED]>
 ===
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:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to