You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Eduardo Nunes <es...@gmail.com> on 2009/04/09 16:06:36 UTC

Package all CSS and JS

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?

Thanks,
Eduardo S. Nunes

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Package all CSS and JS

Posted by Brill Pappin <br...@pappin.ca>.
Yes, I see your point... by including jquery with two different sets,  
you actually make it worse because it can't be cached anymore.
You're only going to gain a minor advantage if you bundle the whole  
possible set (for the whole site) in one download, but I doubt it  
would be worth the trouble for what you'd gain from it.

- Brill Pappin





On 10-Apr-09, at 5:16 PM, Igor Vaynberg wrote:

> my point is that the "just in time" thing will not work
>
> suppose
>
> on page A you use jquery and ext
> on page B you use jquery and yui
>
> using this just-in-time composition you will get two resources:
> jquery+ext and jquery+yui - so you are trading 3 hits for two hits,
> but transferring jquery twice.
>
> even worse, consider on page B you have a dynamic header contributor
> that sometimes adds mootools.
>
> so now you have jquery+ext, jquery+yui, jquery+yui+mootools, in the
> case of the latter you did not actually save a request to the server
> because you still have the jquery+yui+mootools combo, but because you
> are doing this caching the last request which was supposed to be just
> for mootols now also has to carry jquery+yui.
>
> wicket is very dynamic, which makes these kinds of page-oriented
> caching strategies difficult. in order to work correctly everything
> should be oriented around a component, not a page.
>
> -igor
>
>
> On Fri, Apr 10, 2009 at 1:44 PM, Brill Pappin <br...@pappin.ca> wrote:
>> Yah, he's right about the caching... so maybe not work it...  
>> however the
>> solution someone posted was a ... hmm... Just in Time Resource kind  
>> of idea.
>> which would still optimize for whatever page you were on (instead of
>> bundling it all up into one giant file).
>>
>>
>> - Brill Pappin
>>
>>
>>
>>
>>
>> On 10-Apr-09, at 2:55 AM, Jeremy Thomerson wrote:
>>
>>> I think that this response by Igor to another thread was supposed  
>>> to be on
>>> this one.  Either way, it fits this one.
>>>
>>> it is much simpler and more efficient to set proper caching headers.
>>>>
>>>> concatenating resources often does not work because different
>>>> components on different pages contribute different resources, so  
>>>> there
>>>> are a lot of variations of these huge files you may end up with and
>>>> would have to stream to the user over and over. yes, it would  
>>>> only be
>>>> one request per page, but it would be a huge one over and over as
>>>> opposed to being able to cache a lot of small resources and never
>>>> request them again.
>>>>
>>>> -igor
>>>>
>>>
>>> --
>>> Jeremy Thomerson
>>> http://www.wickettraining.com
>>>
>>>
>>>
>>> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com>  
>>> 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?
>>>>
>>>> Thanks,
>>>> Eduardo S. Nunes
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


Re: Package all CSS and JS

Posted by Igor Vaynberg <ig...@gmail.com>.
my point is that the "just in time" thing will not work

suppose

on page A you use jquery and ext
on page B you use jquery and yui

using this just-in-time composition you will get two resources:
jquery+ext and jquery+yui - so you are trading 3 hits for two hits,
but transferring jquery twice.

even worse, consider on page B you have a dynamic header contributor
that sometimes adds mootools.

so now you have jquery+ext, jquery+yui, jquery+yui+mootools, in the
case of the latter you did not actually save a request to the server
because you still have the jquery+yui+mootools combo, but because you
are doing this caching the last request which was supposed to be just
for mootols now also has to carry jquery+yui.

wicket is very dynamic, which makes these kinds of page-oriented
caching strategies difficult. in order to work correctly everything
should be oriented around a component, not a page.

-igor


On Fri, Apr 10, 2009 at 1:44 PM, Brill Pappin <br...@pappin.ca> wrote:
> Yah, he's right about the caching... so maybe not work it... however the
> solution someone posted was a ... hmm... Just in Time Resource kind of idea.
> which would still optimize for whatever page you were on (instead of
> bundling it all up into one giant file).
>
>
> - Brill Pappin
>
>
>
>
>
> On 10-Apr-09, at 2:55 AM, Jeremy Thomerson wrote:
>
>> I think that this response by Igor to another thread was supposed to be on
>> this one.  Either way, it fits this one.
>>
>> it is much simpler and more efficient to set proper caching headers.
>>>
>>> concatenating resources often does not work because different
>>> components on different pages contribute different resources, so there
>>> are a lot of variations of these huge files you may end up with and
>>> would have to stream to the user over and over. yes, it would only be
>>> one request per page, but it would be a huge one over and over as
>>> opposed to being able to cache a lot of small resources and never
>>> request them again.
>>>
>>> -igor
>>>
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>>
>>
>> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com> 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?
>>>
>>> Thanks,
>>> Eduardo S. Nunes
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Package all CSS and JS

Posted by Brill Pappin <br...@pappin.ca>.
Yah, he's right about the caching... so maybe not work it... however  
the solution someone posted was a ... hmm... Just in Time Resource  
kind of idea.
which would still optimize for whatever page you were on (instead of  
bundling it all up into one giant file).


- Brill Pappin





On 10-Apr-09, at 2:55 AM, Jeremy Thomerson wrote:

> I think that this response by Igor to another thread was supposed to  
> be on
> this one.  Either way, it fits this one.
>
> it is much simpler and more efficient to set proper caching headers.
>> concatenating resources often does not work because different
>> components on different pages contribute different resources, so  
>> there
>> are a lot of variations of these huge files you may end up with and
>> would have to stream to the user over and over. yes, it would only be
>> one request per page, but it would be a huge one over and over as
>> opposed to being able to cache a lot of small resources and never
>> request them again.
>>
>> -igor
>>
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com>  
> 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?
>>
>> Thanks,
>> Eduardo S. Nunes
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>


Re: Package all CSS and JS

Posted by Jeremy Thomerson <je...@wickettraining.com>.
I think that this response by Igor to another thread was supposed to be on
this one.  Either way, it fits this one.

it is much simpler and more efficient to set proper caching headers.
> concatenating resources often does not work because different
> components on different pages contribute different resources, so there
> are a lot of variations of these huge files you may end up with and
> would have to stream to the user over and over. yes, it would only be
> one request per page, but it would be a huge one over and over as
> opposed to being able to cache a lot of small resources and never
> request them again.
>
> -igor
>

--
Jeremy Thomerson
http://www.wickettraining.com



On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com> 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?
>
> Thanks,
> Eduardo S. Nunes
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Package all CSS and JS

Posted by Alex Objelean <al...@yahoo.com>.

In case of wro4j, css can be merged no matter where they are located:

"Css url rewriting - after css resources are merged, the relative url will
not point any more to a valid location. That is why it is important to
overwrite the url's in the css files after merging. This is the most
powerful feature of the wro4j and is performed by default by the framework."

Alex


Brill Pappin wrote:
> 
> Ahh... forgot about that...
> It will only work for CSS files that are in the same directory if you  
> want to find other resources like images.
> 
> Can it be done without doubt but its starting o get more complex than  
> is likely worth the trouble since as Igor pointed out, the browser  
> caches them anyway.
> 
> 
> - Brill Pappin
> 
> 
> 
> 
> 
> On 10-Apr-09, at 3:06 AM, Alex Objelean wrote:
> 
>>
>> 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 <br...@pappin.ca>:
>>>
>>>> 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
>>>>> <cr...@tataryn.net> wrote:
>>>>>> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com>
>>>>>> 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: users-unsubscribe@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Craig Tataryn
>>>>>> site: http://www.basementcoders.com/
>>>>>> podcast:http://feeds.feedburner.com/TheBasementCoders
>>>>>> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
>>>>>> im: craiger316@hotmail.com, skype: craig.tataryn
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>
>> -- 
>> 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: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
> 
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/Package-all-CSS-and-JS-tp22971703p22999511.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Package all CSS and JS

Posted by Brill Pappin <br...@pappin.ca>.
Ahh... forgot about that...
It will only work for CSS files that are in the same directory if you  
want to find other resources like images.

Can it be done without doubt but its starting o get more complex than  
is likely worth the trouble since as Igor pointed out, the browser  
caches them anyway.


- Brill Pappin





On 10-Apr-09, at 3:06 AM, Alex Objelean wrote:

>
> 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 <br...@pappin.ca>:
>>
>>> 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
>>>> <cr...@tataryn.net> wrote:
>>>>> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com>
>>>>> 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: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Craig Tataryn
>>>>> site: http://www.basementcoders.com/
>>>>> podcast:http://feeds.feedburner.com/TheBasementCoders
>>>>> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
>>>>> im: craiger316@hotmail.com, skype: craig.tataryn
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> -- 
> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


Re: Package all CSS and JS

Posted by Alex Objelean <al...@yahoo.com>.
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 <br...@pappin.ca>:
> 
>> 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  
>>> <cr...@tataryn.net> wrote:
>>>> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com>  
>>>> 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: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Craig Tataryn
>>>> site: http://www.basementcoders.com/
>>>> podcast:http://feeds.feedburner.com/TheBasementCoders
>>>> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
>>>> im: craiger316@hotmail.com, skype: craig.tataryn
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Package all CSS and JS

Posted by Brill Pappin <br...@pappin.ca>.
You could likely do that fairly easily, but how do you know which ones  
are need by which page?
For instance page A may not need all the CSS that page B does.

- Brill Pappin





On 10-Apr-09, at 2:49 AM, 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 <br...@pappin.ca>:
>
>> 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  
>>> <cr...@tataryn.net> wrote:
>>>> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com>  
>>>> 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: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Craig Tataryn
>>>> site: http://www.basementcoders.com/
>>>> podcast:http://feeds.feedburner.com/TheBasementCoders
>>>> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
>>>> im: craiger316@hotmail.com, skype: craig.tataryn
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


Re: Package all CSS and JS

Posted by Bjoern Tietjens <bj...@web.de>.
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 <br...@pappin.ca>:

> 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  
>> <cr...@tataryn.net> wrote:
>>> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com>  
>>> 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: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>>
>>> --
>>> Craig Tataryn
>>> site: http://www.basementcoders.com/
>>> podcast:http://feeds.feedburner.com/TheBasementCoders
>>> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
>>> im: craiger316@hotmail.com, skype: craig.tataryn
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Package all CSS and JS

Posted by Brill Pappin <br...@pappin.ca>.
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 <cr...@tataryn.net>  
> wrote:
>> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com>  
>> 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: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>>
>> --
>> Craig Tataryn
>> site: http://www.basementcoders.com/
>> podcast:http://feeds.feedburner.com/TheBasementCoders
>> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
>> im: craiger316@hotmail.com, skype: craig.tataryn
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Package all CSS and JS

Posted by Alex Objelean <al...@yahoo.com>.
Take a look to web resource optimizer (wro4j) project, hosted on google code.
It's pretty easy to use:

http://code.google.com/p/wro4j/ wro4j 

Alex


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 <cr...@tataryn.net>
> wrote:
>> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com> 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: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>>
>> --
>> Craig Tataryn
>> site: http://www.basementcoders.com/
>> podcast:http://feeds.feedburner.com/TheBasementCoders
>> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
>> im: craiger316@hotmail.com, skype: craig.tataryn
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Package-all-CSS-and-JS-tp22971703p22978723.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Package all CSS and JS

Posted by Brill Pappin <br...@pappin.ca>.
Oh nice... exactly what I was thinking... glad I don't have to write it!


- Brill Pappin





On 9-Apr-09, at 1:26 PM, Roman Zechner wrote:

> Hi Eduardo!
>
> I remember there was once a discussion here on the mailing list, I  
> think part of that was
>
> http://techblog.molindo.at/2008/08/wicket-interface-speed-up-merging-resources-for-fewer-http-requests.html
>
> Roman
>
>
> Eduardo Nunes wrote:
>> <link href="..." /> for the css
>> and
>> <script language="javascript" src="..." /> for the javascripts
>>
>>
>> On Thu, Apr 9, 2009 at 11:57 AM, Eduardo Nunes <es...@gmail.com>  
>> 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  
>>> <cr...@tataryn.net> wrote:
>>>
>>>> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com>  
>>>> 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: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>>
>>>> --
>>>> Craig Tataryn
>>>> site: http://www.basementcoders.com/
>>>> podcast:http://feeds.feedburner.com/TheBasementCoders
>>>> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
>>>> im: craiger316@hotmail.com, skype: craig.tataryn
>>>>
>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> -- 
> Liland ...does IT better
>
> Liland IT GmbH
> Creative Master
> email: Roman.Zechner@Liland.at
>
> office: +43 (0)463 220-111  | fax: +43 (0)463 220-288 http://www.Liland.at
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Package all CSS and JS

Posted by Roman Zechner <ro...@Liland.at>.
Hi Eduardo!

I remember there was once a discussion here on the mailing list, I think 
part of that was

http://techblog.molindo.at/2008/08/wicket-interface-speed-up-merging-resources-for-fewer-http-requests.html

Roman


Eduardo Nunes wrote:
> <link href="..." /> for the css
> and
> <script language="javascript" src="..." /> for the javascripts
>
>
> On Thu, Apr 9, 2009 at 11:57 AM, Eduardo Nunes <es...@gmail.com> 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 <cr...@tataryn.net> wrote:
>>     
>>> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com> 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: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>         
>>> --
>>> Craig Tataryn
>>> site: http://www.basementcoders.com/
>>> podcast:http://feeds.feedburner.com/TheBasementCoders
>>> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
>>> im: craiger316@hotmail.com, skype: craig.tataryn
>>>
>>>       
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>   

-- 
Liland ...does IT better

Liland IT GmbH
Creative Master
email: Roman.Zechner@Liland.at

office: +43 (0)463 220-111  | fax: +43 (0)463 220-288 http://www.Liland.at 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Package all CSS and JS

Posted by Eduardo Nunes <es...@gmail.com>.
<link href="..." /> for the css
and
<script language="javascript" src="..." /> for the javascripts


On Thu, Apr 9, 2009 at 11:57 AM, Eduardo Nunes <es...@gmail.com> 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 <cr...@tataryn.net> wrote:
>> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com> 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: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>>
>> --
>> Craig Tataryn
>> site: http://www.basementcoders.com/
>> podcast:http://feeds.feedburner.com/TheBasementCoders
>> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
>> im: craiger316@hotmail.com, skype: craig.tataryn
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Package all CSS and JS

Posted by Eduardo Nunes <es...@gmail.com>.
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 <cr...@tataryn.net> wrote:
> On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com> 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: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Craig Tataryn
> site: http://www.basementcoders.com/
> podcast:http://feeds.feedburner.com/TheBasementCoders
> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
> im: craiger316@hotmail.com, skype: craig.tataryn
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Package all CSS and JS

Posted by Craig Tataryn <cr...@tataryn.net>.
On Thu, Apr 9, 2009 at 9:06 AM, Eduardo Nunes <es...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Craig Tataryn
site: http://www.basementcoders.com/
podcast:http://feeds.feedburner.com/TheBasementCoders
irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
im: craiger316@hotmail.com, skype: craig.tataryn