struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <>
Subject Re: Question abt jsp and struts 1.3
Date Thu, 25 Sep 2008 08:27:16 GMT
Pankaj Gupta wrote:
> Hi,
> I am using struts 1.3. I have kept  jsp folder parallel to WEB-INF folder.
> Inside jsp pages I have images folder, where I am keeping the images
> referred by jsp.
> In jsp I giving src of images as as : "images/image-1".
> So when I access  the jsp directly, then I can see  the images.. But if try
> to access  it through action class
> <action name="/ >
> <result =  "Welcome.jsp">
> </action>
> then I can  see the the jsp contents.. but not the image inside it.

That's because the image paths are relative to the page URL the browser 
sees, not to the physical location of the JSP file. You have two simple 

1) adjust your relative paths so they are correct with respect to the 
action URL

2) include an html:base tag [1] in your page header, which will allow 
your relative paths to remain as they are now



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message