Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP page inconsistent in rendering images  RSS feed

 
Mike Ottinger
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

I'm working on a jsp page with Tomcat 5 that displays a list of company forms, sortable by various columns, each row for a form has a tiny envelope icon used for a link. The page displays around 50 forms at the most at one time, when I click on different columns to change the sorting the envelope icons sometimes completely disappear. It's not like a broken path to the image, they simply don't appear. I don't think it's an image caching issue, I placed a query string at the end of the image url with the timestamp to ensure unique, it didn't help. What's weird too is I placed a javascript function to display a little info in the browser's status bar, even when the image has disappeared, that status info still shows. Also, I copy and pasted the view source, placed it in a static html page and retrieved that file in my browser through my server, it shows the images fine so I'm not generating invalid html. Somebody had suggested maybe some css styles were conflicting, I removed all css code, still happens. Is this maybe a weird Tomcat issue? I'm moving this app to a BEA server soon, so I guess I'll know soon enough. Another thing too, the problem is more apparent the more forms I have to list...when I'm only displaying 10 forms, the problem barely shows, but when I'm displaying over 50, the problem will happen a lot more often. Has anybody seen this issue before? Any help is greatly appreciated.

- Mike
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mike,

Does hitting refresh in the browser cause the images to be loaded correctly? Are the URLs for the images all the same or all different? Is it as if the images haven't been loaded, i.e. your ALT text shows instead?

Are you saying that using static HTML taken from "View Source" works fine, i.e. the only time you get the problem is when the page is served via JSP and Tomcat?

If that's the case it does sound like a configuration issue or a quirk of the server. It's not something I've come across before.

Can you post some sample code?

Jules
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In an instance when the images are not appearing, perform a View Source of the rendered HTML page and see if the HTML and image tags are properly formatted. If not, it's probably a server-side issue, if so, it's a client-side issue.
 
Mike Ottinger
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Julian,

Hitting refresh does bring back the images, and yes they're all exactly the same, its a tiny 1k little envelope icon gif that's getting loaded. And yes, doing a view source on the generated html page and re-serving that static page from the same server returns the page with all the images present. So the html is being generated perfectly... I'm wondering if there's some server config for tomcat that helps with this... it's most likely not that simple of a solution I suppose

- Mike
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

So the html is being generated perfectly...

I'm wondering if there's some server config for tomcat that helps with this...


If the HTML is being sent to the browser correctly, there's nothing left to do with Tomcat or your server-side code. Once the HTML s dispatched, it's up to the browser to render it.

What browser have you seen this behavior on? Have you tried it on alternate browsers? What was the behavior there?
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could try setting up a sniffer as a proxy to take a look at the HTTP traffic. I'm thinking that maybe the request for the image is not being generated, or perhaps the response is not being sent by the web server (Tomcat?).

Still dunno why though.

Jules
 
Mike Ottinger
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Julian,
 
Mike Ottinger
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...woops, I'm running on IE 6.0 tomcat is localhost, no network traffic per se. I've added a lot more data to my jsp app, it's loading a lot more forms, therefore more rows, therefore more tiny image icons, it definitely happens a lot more often when there's more data. I'm wondering if doing a re-install of Tomcat might help... I don't know, I'll try anything. I talked with our weblogic admin, he's not sure tomcat would do something like this.. here's the jsp I'm using to generate the html:



simple jsp, kind of fancy html with the status lines and all... but I've pared that html down to the bare-bones, only having it generate the img tag only, still no luck... thanks for the help by the way!

- Mike

(Edited code tag to remove page widening. - Nathan Pruett)
[ August 12, 2004: Message edited by: Nathan Pruett ]
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only thing I an think of that might cause that behaviour is faulty server configuration. A fresh installation would probably cure that... I still don't understand why this sort of behaviour would happen.

What's with the weird HTML event handler names btw?

Jules
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I don't understand is why isn't the browser caching this envelope image and reusing it?
Bill
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have caching switched off in IE?
That is, under Tools => Internet Options => Temporary Internet Files => Settings are you using either of the "Every time" options?
Do you get the same behaviour in any other browser? If not then that would rule out server configuration.

Jules
 
Mike Ottinger
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do have the browser setting to pull the page down each time. I just changed it back to automatic... and it worked... holy moly.. all that time and it's been a browser setting...I had it set to no caching because I wasn't getting the browser to get updates from my server... so... I'll have to remember this for the future. Thanks so much for your help. And the funky event handlers... if you posted code here with javascript functions like that, they're interpreted as malicious code, so they just have you give it a wacky name to get it posted.. thanks again for all the help
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!