So, I fixed that now, but with a bit of a hack.
Basically, this is my problem: I just have a few different images, that are reused within the tree quite often. Instead having a different url for them all, they should really point to the same image. I solved this by declaring the images I want as static variables, setting their sharing to application level, and then using the url's to these component with the real image components, like:
String url = getRequestCycle().urlFor(JUNCTION_IMG_BLANK, IResourceListener.class);
Naturally, this is not a very elegant solution. But... I can't think of a better way to do this currently.
Btw, I looked a bit a the browser's behaviour. It really seems that the default behaviour is fine (the browser regconizes that is has some images allready), so I think cachability is nice as it is without tinkering with response cache headers...
Eelco
Jonathan Locke wrote:
can you bug this against me? this is something we have to fix for 1.0.
thanks,
jon
Eelco Hillenius wrote:
As there is getPage().getClass(), it will allways look for resources relative to the package where the current page is in, which is not right I think. For one thing, I had to hack a bit for the tree to be able to include images from the same package as where the tree is in.
ugh. right. i need to think about this one a bit...
one thing that pops in my head is that this logic doesn't belong in getResource(). it might instead call a method getResourcePath(String resourcePath), passing in the resourcePath from the src tag.
but i think there's more to it...
It's a nasty one.
Any idea's how this should be solved best? I though about getParent().getClass(), but that would be very unpredictable.
Btw, has any work been done to set the cache headers of those application/ session scoped resources?
nope. that would be a good idea. when should a shared "dynamic" image expire? maybe use a good default and give the user control here?
I guess the same as session timeout would be a nice default... Johan, do you have a good idea about this one?
Eelco
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
