Hi,

A few months back I started work on a slightly different method of adding
resources to a page, where, it works out what resources are added on the
page, combines them together with the yui javascript compressor, caches the
result, and serves it.

Unfortunately I haven't had any time to work on it as my new job has taken
me away from wicket, but I am happy to share my rough code with anyone that
wants it.

resources are added like so:
HeaderContribManager.add(new ResourceReference(...), getPage());

and in each page add
HeaderContribManager.getHeaderContributor(this.class, localString,
styleString);

in both cases put in the onBeforeRender method (the panels and such need to
be added to the page before you can use getPage() afaik)

Like I said its very rough, but it does have the advantage of producing a js
file for each page, hopefully taking into account local and style, and
should work when a panel adds javascript, and you use that panel in multiple
pages.

http://www.nabble.com/file/p19170189/HeaderContribManager.java
HeaderContribManager.java 


>>> <[EMAIL PROTECTED]> wrote:
>>>> I've been hearing some rants on how merging resources can up the
>>>> performance, should wicket be able todo this? I mean merging several
>>>> css's
>>>> into one etc.. I know it wont work for dynamic css/js/images. But on
>>>> static
>>>> it could, even yslow recommends you merge your resources into one... 
>>>> Images
>>>> might be stretching it too far?
>>>>
>>>> WDYT?
>>>>
>>>>
>>>> http://workingwithrails.com/railsplugin/5317-asset-packager
>>>> http://www.kaboomerang.com/blog/2007/11/29/getting-to-10-actiontastic-actionatr-gwt-and-automagic-rest/
>>>>


-----
http://www.richard-wilkinson.co.uk My blog:
http://www.richard-wilkinson.co.uk 
-- 
View this message in context: 
http://www.nabble.com/Wicket-resources-%28css%2C-js-and-images%29--tp19160980p19170189.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to