Gili wrote:
I forgot to ask: does this mean we no longer need to explicitly add(new Image("beer")) if the markup contains the <img> tag? That is, do we automatically add static images to the component? If not, how is this any different from the preexisting implementation? Is it that we simply add the image to the application cache and don't re-render it if it already exists?
we do not yet auto-add Image components. that RFE is still open.
what we do do now is automatically share packaged resources. this is the first step in that RFE (which will have to wait for 1.1). the trouble with the earlier implementation (and what johan and i were talking about) is that it was very inefficient unless you knew what to do in terms of sharing and resource references. it's now efficient by default.
so if you are using packaged images, i think you will find it's faster. and i think my streams update yesterday will also make your images a lot faster. give the latest snapshot a try tomorrow and see if it's not all a lot better.
jon
Gili
Jonathan Locke wrote:
actually, it /was/ bad practice. it is now automatically efficient. if you look at the /very same/ pub example now, you'll see that
add(new Image("beer"));
and
<img wicket:id = "beer" src = "Beer.gif"/>
results in this URL
http://localhost:8080/pub/resources/wicket.examples.pub.Home_Beer.gif
in other words (gili, are you listening?), you don't have to do anything to make your packaged resources cached and efficient now. just attach an Image component to the IMG tag and it will automatically do efficient resource sharing and referencing.
of course, if you want more control, you have it. but this takes care of a very common case (want localized, packaged image resources).
i think this is the beauty of good encapsulation in OO programming. if we exposed URLs all over the place, for example, we couldn't do this kind of thing. since we actually have abstractions for images, resources and resource references... i can go make globally optimizing changes like this without affecting anyone.
Gili wrote:
I don't get it. What is bad practice? Can you rephrase it?
Gili
Johan Compagner wrote:
I will make it so that when caching is not allowed i don't set anything (so also not the last modified time of the file)
But that example is ofcourse wrong.. And we should teach people to never return just images from files under
the same, not shared/static resource url. This is just bad practice.
-------------------------------------------------------
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
------------------------------------------------------- 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
