Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Other Open Source Projects and the fly likes Cewolf - PreLoad Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Cewolf - PreLoad" Watch "Cewolf - PreLoad" New topic
Author

Cewolf - PreLoad

MichaelJ McCabe
Ranch Hand

Joined: Feb 09, 2010
Posts: 49
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?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41863
    
  63
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.


Ping & DNS - my free Android networking tools app
MichaelJ McCabe
Ranch Hand

Joined: Feb 09, 2010
Posts: 49
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
Marshal

Joined: Mar 22, 2005
Posts: 41863
    
  63
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: http://www.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).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cewolf - PreLoad