• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Cewolf - PreLoad

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question is really directed at Ulf, but perhaps someone else can help too.

I apear to be having issues with, every now and again, the ceworlf images loading. Now, these images are links to larger graphs which are populated from the data passed to Cewolf graphs.

Every now and again, some images just show blank, but when clicked on, the data is there.

The only thing I can think of is that the data is being loaded (I am using struts with actions, so all the calculations and data formatting has to be done before the page loads), but the images are not being created quick enough to display?

If I am right (which I am not 100% about). How do I go about ensuring that the Cewolf images preload before they are shown?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the images are not created until the web page in which they appear accesses them (which means that if a JSP page has a cewolf:chart tag, but no corresponding cewolf:img tag, then they aren't created at all).

If a page contains multiple images, then it'll take a while until all are being requested, generated, and returned to the browser (because browsers only send a few requests in parallel). The "Cewolf Set" page of the sample web app is an example of a page where this can be observed.

If this is repeatable behavior -and it probably isn't- then I'd check the web access logs to see if the image requests reach the server, and use something like the Firefox extension LiveHTTPHeaders to see if those requests are sent by the browser. This might provide clues as to what's going on.
 
MichaelJ McCabe
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Well, the images are not created until the web page in which they appear accesses them (which means that if a JSP page has a cewolf:chart tag, but no corresponding cewolf:img tag, then they aren't created at all).

If a page contains multiple images, then it'll take a while until all are being requested, generated, and returned to the browser (because browsers only send a few requests in parallel). The "Cewolf Set" page of the sample web app is an example of a page where this can be observed.

If this is repeatable behavior -and it probably isn't- then I'd check the web access logs to see if the image requests reach the server, and use something like the Firefox extension LiveHTTPHeaders to see if those requests are sent by the browser. This might provide clues as to what's going on.



Thanks for your response.

Its not repeatable unfortunatily, but it is happening every one in a thousand. And it really cant happen at all. Is there a way of preloading? Regardless of solving the issue, it would make the page look neater if this could be done.


Also Ulf, the bug fix
•BUG FIX: Memory leak when using the <imgurl> tag

when was this done?


And Finally, where is this "Cewolf Set" page? Dont want to sound like an idiot, but I cannot find it anywhere (In your distribution or the original)
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is there a way of preloading? Regardless of solving the issue, it would make the page look neater if this could be done.


That process is driven completely by the client side. If you want to load all images before showing them, then you could write JavaScript code that loads all the images into the page, and then turns on their visibility all at once. I'm not sure the effect would necessarily be prettier than having the browser load the images progressively, though, and there would be a delay before they're visible. (Come to think of it, I'm not sure if JavaScript can determine whether or not an image is fully loaded, so this may not work at all.)

BUG FIX: Memory leak when using the <imgurl> tag
when was this done?


About a week ago: https://coderanch.com/t/500782/open-source/OutOfMemory-when-CeWolf-JFreeChart#2259053

And Finally, where is this "Cewolf Set" page? Dont want to sound like an idiot, but I cannot find it anywhere (In your distribution or the original)


It's one of the pages in the "cewolfexample" web app that comes with the distribution (not sure if that web app also came with original distribution, though).
 
reply
    Bookmark Topic Watch Topic
  • New Topic