You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Arne And <ar...@gmail.com> on 2011/09/27 12:03:17 UTC
Wicket 1.5.0 and ResourceReferences
How do I avoid the -ver-XXX version number from my resource reference
in Wicket 1.5.0?
More details:
I want to use Scriptaculous, and have a AbstractDefaultAjaxBehavior
that does a renderHead(...) { response.renderJavaScriptReference(new
JavaScriptResourceReference(this.getClass(), "scriptaculous.js"); }
This adds the <script src ... > to the header section, however, the
url to the scriptaculous includes the Wickek -ver-XXX rewrite. This in
turn results in the scriptaculous auto include
builder,effects,dragdrop etc not to load properly, due to how the
script determines the base path.
I can of course fix the way scriptaculous determines the path, but the
best way would be to have wicket serve this up as "scriptaculous.js".
What am I doing wrong? Can it be fixed?
I've looked at the FilenameWithVersionResourceCachingStrategy, and I
know I can change that for the application, but won't I then change it
for all the resources? I would like only this to _not_ have the
version information.
Thanks in advance.
A
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket 1.5.0 and ResourceReferences
Posted by Martin Grigorov <mg...@apache.org>.
On Wed, Sep 28, 2011 at 9:58 AM, Arne And <ar...@gmail.com> wrote:
> As far as I understand, both suggested solutions work on the entire
> application, right? Is there no way to define a particular resource
> caching strategy for a particular resource or set of resources, e.g.
> set a resource strategy for all javascript resources, but leave
> everything else default?
Of course there is :-)
You can roll your own strategy that delegates to X strategy for some
resources and to Y strategy for other resources.
>
> A
>
> On Tue, Sep 27, 2011 at 5:40 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>> switch to QueryStringWithVersionResourceCachingStrategy, it does not
>> modify file names
>>
>> -igor
>>
>>
>> On Tue, Sep 27, 2011 at 3:03 AM, Arne And <ar...@gmail.com> wrote:
>>> How do I avoid the -ver-XXX version number from my resource reference
>>> in Wicket 1.5.0?
>>>
>>> More details:
>>>
>>> I want to use Scriptaculous, and have a AbstractDefaultAjaxBehavior
>>> that does a renderHead(...) { response.renderJavaScriptReference(new
>>> JavaScriptResourceReference(this.getClass(), "scriptaculous.js"); }
>>>
>>> This adds the <script src ... > to the header section, however, the
>>> url to the scriptaculous includes the Wickek -ver-XXX rewrite. This in
>>> turn results in the scriptaculous auto include
>>> builder,effects,dragdrop etc not to load properly, due to how the
>>> script determines the base path.
>>>
>>> I can of course fix the way scriptaculous determines the path, but the
>>> best way would be to have wicket serve this up as "scriptaculous.js".
>>>
>>> What am I doing wrong? Can it be fixed?
>>>
>>> I've looked at the FilenameWithVersionResourceCachingStrategy, and I
>>> know I can change that for the application, but won't I then change it
>>> for all the resources? I would like only this to _not_ have the
>>> version information.
>>>
>>> Thanks in advance.
>>>
>>> A
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Wicket 1.5.0 and ResourceReferences
Posted by Arne And <ar...@gmail.com>.
As far as I understand, both suggested solutions work on the entire
application, right? Is there no way to define a particular resource
caching strategy for a particular resource or set of resources, e.g.
set a resource strategy for all javascript resources, but leave
everything else default?
A
On Tue, Sep 27, 2011 at 5:40 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> switch to QueryStringWithVersionResourceCachingStrategy, it does not
> modify file names
>
> -igor
>
>
> On Tue, Sep 27, 2011 at 3:03 AM, Arne And <ar...@gmail.com> wrote:
>> How do I avoid the -ver-XXX version number from my resource reference
>> in Wicket 1.5.0?
>>
>> More details:
>>
>> I want to use Scriptaculous, and have a AbstractDefaultAjaxBehavior
>> that does a renderHead(...) { response.renderJavaScriptReference(new
>> JavaScriptResourceReference(this.getClass(), "scriptaculous.js"); }
>>
>> This adds the <script src ... > to the header section, however, the
>> url to the scriptaculous includes the Wickek -ver-XXX rewrite. This in
>> turn results in the scriptaculous auto include
>> builder,effects,dragdrop etc not to load properly, due to how the
>> script determines the base path.
>>
>> I can of course fix the way scriptaculous determines the path, but the
>> best way would be to have wicket serve this up as "scriptaculous.js".
>>
>> What am I doing wrong? Can it be fixed?
>>
>> I've looked at the FilenameWithVersionResourceCachingStrategy, and I
>> know I can change that for the application, but won't I then change it
>> for all the resources? I would like only this to _not_ have the
>> version information.
>>
>> Thanks in advance.
>>
>> A
>>
>> ---------------------------------------------------------------------
>> 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: Wicket 1.5.0 and ResourceReferences
Posted by Igor Vaynberg <ig...@gmail.com>.
switch to QueryStringWithVersionResourceCachingStrategy, it does not
modify file names
-igor
On Tue, Sep 27, 2011 at 3:03 AM, Arne And <ar...@gmail.com> wrote:
> How do I avoid the -ver-XXX version number from my resource reference
> in Wicket 1.5.0?
>
> More details:
>
> I want to use Scriptaculous, and have a AbstractDefaultAjaxBehavior
> that does a renderHead(...) { response.renderJavaScriptReference(new
> JavaScriptResourceReference(this.getClass(), "scriptaculous.js"); }
>
> This adds the <script src ... > to the header section, however, the
> url to the scriptaculous includes the Wickek -ver-XXX rewrite. This in
> turn results in the scriptaculous auto include
> builder,effects,dragdrop etc not to load properly, due to how the
> script determines the base path.
>
> I can of course fix the way scriptaculous determines the path, but the
> best way would be to have wicket serve this up as "scriptaculous.js".
>
> What am I doing wrong? Can it be fixed?
>
> I've looked at the FilenameWithVersionResourceCachingStrategy, and I
> know I can change that for the application, but won't I then change it
> for all the resources? I would like only this to _not_ have the
> version information.
>
> Thanks in advance.
>
> A
>
> ---------------------------------------------------------------------
> 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: Wicket 1.5.0 and ResourceReferences
Posted by Arne And <ar...@gmail.com>.
Hmm. I see. This is not the solution I hoped for. I liked the
public Time getLastModified() {
return null;
}
method on the ResourceReference...
oh well...
A
On Tue, Sep 27, 2011 at 12:06 PM, Martin Grigorov <mg...@apache.org> wrote:
> Override org.apache.wicket.request.resource.caching.FilenameWithVersionResourceCachingStrategy.decorateUrl(ResourceUrl,
> IStaticCacheableResource) and call super only if this is not the
> Prototype resource.
> Use ResourceUrl to get the name of the resource.
>
> On Tue, Sep 27, 2011 at 12:03 PM, Arne And <ar...@gmail.com> wrote:
>> How do I avoid the -ver-XXX version number from my resource reference
>> in Wicket 1.5.0?
>>
>> More details:
>>
>> I want to use Scriptaculous, and have a AbstractDefaultAjaxBehavior
>> that does a renderHead(...) { response.renderJavaScriptReference(new
>> JavaScriptResourceReference(this.getClass(), "scriptaculous.js"); }
>>
>> This adds the <script src ... > to the header section, however, the
>> url to the scriptaculous includes the Wickek -ver-XXX rewrite. This in
>> turn results in the scriptaculous auto include
>> builder,effects,dragdrop etc not to load properly, due to how the
>> script determines the base path.
>>
>> I can of course fix the way scriptaculous determines the path, but the
>> best way would be to have wicket serve this up as "scriptaculous.js".
>>
>> What am I doing wrong? Can it be fixed?
>>
>> I've looked at the FilenameWithVersionResourceCachingStrategy, and I
>> know I can change that for the application, but won't I then change it
>> for all the resources? I would like only this to _not_ have the
>> version information.
>>
>> Thanks in advance.
>>
>> A
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.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
Re: Wicket 1.5.0 and ResourceReferences
Posted by Martin Grigorov <mg...@apache.org>.
Override org.apache.wicket.request.resource.caching.FilenameWithVersionResourceCachingStrategy.decorateUrl(ResourceUrl,
IStaticCacheableResource) and call super only if this is not the
Prototype resource.
Use ResourceUrl to get the name of the resource.
On Tue, Sep 27, 2011 at 12:03 PM, Arne And <ar...@gmail.com> wrote:
> How do I avoid the -ver-XXX version number from my resource reference
> in Wicket 1.5.0?
>
> More details:
>
> I want to use Scriptaculous, and have a AbstractDefaultAjaxBehavior
> that does a renderHead(...) { response.renderJavaScriptReference(new
> JavaScriptResourceReference(this.getClass(), "scriptaculous.js"); }
>
> This adds the <script src ... > to the header section, however, the
> url to the scriptaculous includes the Wickek -ver-XXX rewrite. This in
> turn results in the scriptaculous auto include
> builder,effects,dragdrop etc not to load properly, due to how the
> script determines the base path.
>
> I can of course fix the way scriptaculous determines the path, but the
> best way would be to have wicket serve this up as "scriptaculous.js".
>
> What am I doing wrong? Can it be fixed?
>
> I've looked at the FilenameWithVersionResourceCachingStrategy, and I
> know I can change that for the application, but won't I then change it
> for all the resources? I would like only this to _not_ have the
> version information.
>
> Thanks in advance.
>
> A
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org