[opencms-dev] OpenCMS Occassionally Serving wrong images

Alexander Kandzior alex at opencms.org
Fri Oct 14 10:42:47 CEST 2011


Brett,

 

src="img/pic1.jpg"

 

don't do this in JSP pages! Better use the <cms:image> tag OR at least the
<cms:link> tag to link to the image.

 

I am pretty sure this would solve your problem. I suspect the relative image
path is cause of your trouble.

 

BTW if you use <img src=.> directly in you JSPs then OpenCms will NOT change
the image path in any way.

 

Kind Regards,

Alex.

-------------------

Alexander Kandzior

                                                              

Alkacon Software GmbH  - The OpenCms Experts                 

http://www.alkacon.com - http://www.opencms.org                  

 

 

From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Brett Sheeran
Sent: Friday, October 14, 2011 8:03 AM
To: opencms-dev at opencms.org
Subject: Re: [opencms-dev] OpenCMS Occassionally Serving wrong images

 

Hi,

This is going to sound like a bizarre question, but is there the *faintest*
possibility that OpenCMS could be changing image "src" paths in HTML? The
reason I ask is that in the access logs we found two instances what appears
to be a browser requesting an image that shouldn't be in the associated
page. Details as follows.

Normally, a request for a particular page is closely followed by a request
for an associated image from the same IP address like so:
GET /opencms/folder1/page.html
...
GET /opencms/folder1/img/pic1.jpg
...

However, on 2 occasions, we have found instances where the request from the
same IP address was for an alternate image that shouldn't even by in the
page like so:
GET /opencms/folder1/page.html
...
GET /opencms/differentFolder/img/differentPic.jpg
...

This behaviour coincides with the user seeing the wrong image in place of
pic1.jpg

The image tag is hard coded in a JSP element like so:
<img id="tpposter" border="0" src="img/pic1.jpg" width="287px"
height="192px"/>

Whereas, there is absolutely no reference to differentPic.jpg in the page.

So, I can't see how it could possibility change. Furthermore, hitting the
refresh button 30 seconds later cleared the problem and there were no other
pages requests occurring at the same time.

I am going to try some stress testing and also rolling back to an earlier
version of Tomcat (as per Alex's suggestion). 

 

I apologise for continuously bringing this up but it's driing me crazy.

 

Thank you.

Regards Brett

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20111014/32603092/attachment.htm>


More information about the opencms-dev mailing list