Apache HTTPD + Tomcat and random missing images

A

Anders Skar

Hi!

I have set up a webapplication running on Apache HTTPD + Tomcat,
running
Apache as a frontend for Tomcat. The application is deployed as a war
file om Tomcat.

We have a strange problem, that random images are missing from pages.
I reload a page or navigate to a other the missing images load
perfectly.

It's not an error in the application, I've tried to deploy the
application on JBoss, and it works fine.

Can anyone give me a clue to why this happens?

Anders Skar
 
W

Wendy S

Anders Skar said:
We have a strange problem, that random images are missing from pages.
I reload a page or navigate to a other the missing images load
perfectly.
Can anyone give me a clue to why this happens?

What does the HTML source of a page with missing images look like? How are
you generating the <img> tag or the URL to the image?

I had a similar problem and found that ?jsessionid was getting appended to
the image URL's, and since I have Apache serve my images off the root of the
webserver, it had no idea what to do.
 
S

Sudsy

Wendy said:
What does the HTML source of a page with missing images look like? How are
you generating the <img> tag or the URL to the image?

I had a similar problem and found that ?jsessionid was getting appended to
the image URL's, and since I have Apache serve my images off the root of the
webserver, it had no idea what to do.

This is one of those situations where you have to carefully consider
whether you want <html:img> or plain <img> tags. If you're dynamically
generating content then the Struts <html:img> tag is the right choice.
Note that the documentation specifically mentions that "URL rewriting
will be applied automatically to the value specified in src, page, or
action to maintain session state in the absence of cookies".
If you want Apache to serve up static content then just use <img> tags
and the paths won't get corrupted.
Sometimes Struts tries to do TOO much for you...
ps. View the source of the offending pages to give yourself more debug
information.
 
A

Anders Skar

I use plain <IMG> tags and the HTML source is always correct. This is
not a problem with the URL's being wrong or something being appended
to the URL.

The problem is that even the source is correct, some of the bitmaps
are missing, like they were not present on the server. And this
happens randomly (if I reload the page the bitmaps display sometimes
display ok, sometimes they are missing).

Anders
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top