You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Toscano <ko...@gmail.com> on 2009/12/02 07:51:23 UTC

Re: Announcement: Annotation-based Mounting of Resources

Hi again,

First of all, thank you for your time and dedication with this project, I
think is really useful and interesting.

I just can't have it working and I don't know the reason, I would really
appreciate if you can spend a few minutes trying to help me if you don't
mind.

I'm using Wicket 1.4.3 and the annotations approach. My javascript files are
all in /js not in the java folder.

So what I do is go the init() of my webapp and write this:

        ResourceMount mount = new ResourceMount();
        ResourceMount.mountAnnotatedPackageResources("/js",
"MyApplication.Page", this, mount);

Then I go to MyApplication.Page.HomePage and write this annotation:
@JsContribution("jquery.min.js")

When I try to run the application, I get this error:
 failed to mount resource ('/js/all.js')
WicketRuntimeException: js/all.js is already mounted for
SharedResourceEncoder

I'm sure I'm understanding something wrong... hope you can help me...

Thank you again,
Oskar













sfussenegger wrote:
> 
> Today, I’m happy to announce the availability of annotation-based 
> mounting and merging of resources in wicketstuff-merged-resources 
> (version 3.0-SNAPSHOT for Wicket 1.4, version 2.1-SNAPSHOT for Wicket 
> 1.3). In order to mount resources, all that’s needed is adding 
> annotations to component classes:
> 
> @JsContribution
> @CssContribution(media = "print")
> @ResourceContribution(value = "accept.png", path = "/img/accept.png")
> public class PanelOne extends Panel {
> 
>      public PanelOne(String id) {
>          super(id);
>          // ...
>      }
> }
> 
> As an added benefit, you’ll get all the other features of 
> wicketstuff-merged-resources:
> 
> merging of multiple files into one for less HTTP requests
> adding of versions to resource paths for aggressive caching
> pre-processing of resources (e.g. replacing colors in CSS files)
> optionally uploading them to Amazon Cloudfront (well, at least you can 
> expect this feature soon – we are using it already)
> So you will speed up rendering of your pages while simplifying and 
> reducing your code (there’s no need to merge, mount or add 
> HeaderContributors manually anymore)!
> 
> More on our blog ...
> http://techblog.molindo.at/2009/10/wicket-annotation-based-mounting-of-resources.html
> 
> ... and Wicket Stuff Wiki:
> http://wicketstuff.org/confluence/display/STUFFWIKI/wicketstuff-merged-resources
> 
> Cheers
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 
> -----
> Stefan Fussenegger
> 
> Wicket:
> wicketstuff-merged-resources 
> Wicket on techblog.molindo.at 
> 

-- 
View this message in context: http://old.nabble.com/Announcement%3A-Annotation-based-Mounting-of-Resources-tp25886703p26604363.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: Announcement: Annotation-based Mounting of Resources

Posted by sfussenegger <st...@molindo.at>.
Hi James,

Sorry for the late response. I would personally say: no, it isn't saving
that much. I use these "few helper methods" that are also part of the
project. However, some people requested support for annotations and like
using it. Additionally, it fits pretty well with wicketstuff-annotations'
mounting of pages (which I neither use myself).

So at the the, it's a live and let live thing :) 

Cheers, Stefan


James Carman-3 wrote:
> 
> Is this annotation-based approach really saving that much?  It seems
> to me that a few helper methods would do just as well.
> 
> On Wed, Dec 2, 2009 at 1:51 AM, Toscano <ko...@gmail.com> wrote:
>>
>> Hi again,
>>
>> First of all, thank you for your time and dedication with this project, I
>> think is really useful and interesting.
>>
>> I just can't have it working and I don't know the reason, I would really
>> appreciate if you can spend a few minutes trying to help me if you don't
>> mind.
>>
>> I'm using Wicket 1.4.3 and the annotations approach. My javascript files
>> are
>> all in /js not in the java folder.
>>
>> So what I do is go the init() of my webapp and write this:
>>
>>        ResourceMount mount = new ResourceMount();
>>        ResourceMount.mountAnnotatedPackageResources("/js",
>> "MyApplication.Page", this, mount);
>>
>> Then I go to MyApplication.Page.HomePage and write this annotation:
>> @JsContribution("jquery.min.js")
>>
>> When I try to run the application, I get this error:
>>  failed to mount resource ('/js/all.js')
>> WicketRuntimeException: js/all.js is already mounted for
>> SharedResourceEncoder
>>
>> I'm sure I'm understanding something wrong... hope you can help me...
>>
>> Thank you again,
>> Oskar
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> sfussenegger wrote:
>>>
>>> Today, I’m happy to announce the availability of annotation-based
>>> mounting and merging of resources in wicketstuff-merged-resources
>>> (version 3.0-SNAPSHOT for Wicket 1.4, version 2.1-SNAPSHOT for Wicket
>>> 1.3). In order to mount resources, all that’s needed is adding
>>> annotations to component classes:
>>>
>>> @JsContribution
>>> @CssContribution(media = "print")
>>> @ResourceContribution(value = "accept.png", path = "/img/accept.png")
>>> public class PanelOne extends Panel {
>>>
>>>      public PanelOne(String id) {
>>>          super(id);
>>>          // ...
>>>      }
>>> }
>>>
>>> As an added benefit, you’ll get all the other features of
>>> wicketstuff-merged-resources:
>>>
>>> merging of multiple files into one for less HTTP requests
>>> adding of versions to resource paths for aggressive caching
>>> pre-processing of resources (e.g. replacing colors in CSS files)
>>> optionally uploading them to Amazon Cloudfront (well, at least you can
>>> expect this feature soon – we are using it already)
>>> So you will speed up rendering of your pages while simplifying and
>>> reducing your code (there’s no need to merge, mount or add
>>> HeaderContributors manually anymore)!
>>>
>>> More on our blog ...
>>> http://techblog.molindo.at/2009/10/wicket-annotation-based-mounting-of-resources.html
>>>
>>> ... and Wicket Stuff Wiki:
>>> http://wicketstuff.org/confluence/display/STUFFWIKI/wicketstuff-merged-resources
>>>
>>> Cheers
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>> -----
>>> Stefan Fussenegger
>>>
>>> Wicket:
>>> wicketstuff-merged-resources
>>> Wicket on techblog.molindo.at
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Announcement%3A-Annotation-based-Mounting-of-Resources-tp25886703p26604363.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
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 


-----
Stefan Fussenegger

Wicket:
http://wicketstuff.org/confluence/display/STUFFWIKI/wicketstuff-merged-resources
wicketstuff-merged-resources 
http://techblog.molindo.at/ Wicket on techblog.molindo.at 
-- 
View this message in context: http://old.nabble.com/Announcement%3A-Annotation-based-Mounting-of-Resources-tp25886703p26891019.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: Announcement: Annotation-based Mounting of Resources

Posted by James Carman <jc...@carmanconsulting.com>.
Is this annotation-based approach really saving that much?  It seems
to me that a few helper methods would do just as well.

On Wed, Dec 2, 2009 at 1:51 AM, Toscano <ko...@gmail.com> wrote:
>
> Hi again,
>
> First of all, thank you for your time and dedication with this project, I
> think is really useful and interesting.
>
> I just can't have it working and I don't know the reason, I would really
> appreciate if you can spend a few minutes trying to help me if you don't
> mind.
>
> I'm using Wicket 1.4.3 and the annotations approach. My javascript files are
> all in /js not in the java folder.
>
> So what I do is go the init() of my webapp and write this:
>
>        ResourceMount mount = new ResourceMount();
>        ResourceMount.mountAnnotatedPackageResources("/js",
> "MyApplication.Page", this, mount);
>
> Then I go to MyApplication.Page.HomePage and write this annotation:
> @JsContribution("jquery.min.js")
>
> When I try to run the application, I get this error:
>  failed to mount resource ('/js/all.js')
> WicketRuntimeException: js/all.js is already mounted for
> SharedResourceEncoder
>
> I'm sure I'm understanding something wrong... hope you can help me...
>
> Thank you again,
> Oskar
>
>
>
>
>
>
>
>
>
>
>
>
>
> sfussenegger wrote:
>>
>> Today, I’m happy to announce the availability of annotation-based
>> mounting and merging of resources in wicketstuff-merged-resources
>> (version 3.0-SNAPSHOT for Wicket 1.4, version 2.1-SNAPSHOT for Wicket
>> 1.3). In order to mount resources, all that’s needed is adding
>> annotations to component classes:
>>
>> @JsContribution
>> @CssContribution(media = "print")
>> @ResourceContribution(value = "accept.png", path = "/img/accept.png")
>> public class PanelOne extends Panel {
>>
>>      public PanelOne(String id) {
>>          super(id);
>>          // ...
>>      }
>> }
>>
>> As an added benefit, you’ll get all the other features of
>> wicketstuff-merged-resources:
>>
>> merging of multiple files into one for less HTTP requests
>> adding of versions to resource paths for aggressive caching
>> pre-processing of resources (e.g. replacing colors in CSS files)
>> optionally uploading them to Amazon Cloudfront (well, at least you can
>> expect this feature soon – we are using it already)
>> So you will speed up rendering of your pages while simplifying and
>> reducing your code (there’s no need to merge, mount or add
>> HeaderContributors manually anymore)!
>>
>> More on our blog ...
>> http://techblog.molindo.at/2009/10/wicket-annotation-based-mounting-of-resources.html
>>
>> ... and Wicket Stuff Wiki:
>> http://wicketstuff.org/confluence/display/STUFFWIKI/wicketstuff-merged-resources
>>
>> Cheers
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>> -----
>> Stefan Fussenegger
>>
>> Wicket:
>> wicketstuff-merged-resources
>> Wicket on techblog.molindo.at
>>
>
> --
> View this message in context: http://old.nabble.com/Announcement%3A-Annotation-based-Mounting-of-Resources-tp25886703p26604363.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
>
>

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