The problem with merging css is that the backgrounds will not work anymore (in case the images are referenced relatively). But there is a solution for this, check web resource optimizer ( http://code.google.com/p/wro4j/ wro4j ). It performs url rewriting. Also, resources can be located anywhere (classpath, disk, relative or absolute url, etc.).
Alex Bjoern Tietjens wrote: > > Hi, > how about doing this with some kind of precompilation step? You could > manipulate the code with maven or ant befor packing the war having an > task combining all js and css in one. > > Just an idea... > > Cheers > Bjoern Tietjens > > > Am 10.04.2009 um 05:31 schrieb Brill Pappin <[email protected]>: > >> Funny, I was thinking that same thing... >> in one quick app i was writing, I had ~20 header links! >> I kept thinking "that can't be good" :) >> >> although I have not done so yet, I think there must be a way to >> modify or create a resource loader that would generate a buffered >> version of css (for isntance) and change the request page to just >> load it. >> >> Let us know if you tackle that one... I'd love to see the code. >> >> - Brill Pappin >> >> >> >> >> >> On 9-Apr-09, at 10:57 AM, Eduardo Nunes wrote: >> >>> I think that I didn't explain it right. What I want is that wicket >>> concatenate all included javascripts into one file. Something like >>> <wicket:link> >>> <link.. javascript1.js /> >>> <link.. javascript2.js /> >>> <link.. javascript3.js /> >>> </wicket:link> >>> >>> Generate just one resource with "javacript1.js", "javacript2.js" and >>> "javacript3.js" concatenated. The reason for that is to reduce the >>> number of requests. I have a project that includes almost 10 >>> javascripts files and around 7 css files, it would be faster if the >>> browser has to download just 2 files, one for all javascript and >>> another one for css. >>> >>> I can do it with a servlet or something like this, but I want a >>> solution that works inside wicket, that i don't have to change my >>> source code. >>> >>> Probably wicket has a piece of source code responsible for the >>> <wicket:head> tag, If I could intercept it and get all included >>> javascripts, remove them from the generated html and include my own >>> resource with all javascripts concatenated, I would be happy hehehe >>> >>> Please ask me if you don't understand, I have to improve my >>> english :( >>> >>> Thanks, >>> Eduardo S. Nunes >>> >>> On Thu, Apr 9, 2009 at 11:42 AM, Craig Tataryn >>> <[email protected]> wrote: >>>> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <[email protected]> >>>> wrote: >>>> >>>>> Hi, >>>>> >>>>> Is there a way to tell wicket to package all referenced javascripts >>>>> together, the same for the css? If there isn't this solution yet, >>>>> can >>>>> anyone tell me where should I look for to implement it? >>>>> >>>> >>>> You can put your resources, like css and javascript, directly in >>>> your >>>> packages either under src/main/java or src/main/resources and >>>> include them >>>> through header inclusions using a ResourceReference >>>> >>>> Craig. >>>> >>>> >>>>> Thanks, >>>>> Eduardo S. Nunes >>>>> >>>>> --- >>>>> ------------------------------------------------------------------ >>>>> To unsubscribe, e-mail: [email protected] >>>>> For additional commands, e-mail: [email protected] >>>>> >>>>> >>>> >>>> >>>> -- >>>> Craig Tataryn >>>> site: http://www.basementcoders.com/ >>>> podcast:http://feeds.feedburner.com/TheBasementCoders >>>> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin >>>> im: [email protected], skype: craig.tataryn >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > > -- View this message in context: http://www.nabble.com/Package-all-CSS-and-JS-tp22971703p22984088.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]
