You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sergiy Barlabanov <co...@sergiy-barlabanov.de> on 2015/04/16 23:28:44 UTC

Package resource location does not consider current session style and locale

We are using Wicket 6.15 (but the code seems unchanged in the latest Wicket 6
releases).
We set style to Wicket session and expect Wicket to consider the style when
loading CSS package resources. But this does not work.
Seems to be some kind of inconsistency in PackageResource class.
It uses PackageResource#getCacheableResourceStream() method to calculate the
cache key of the resource (and the timestamp when generating the resource
url). This method considers Session.get().getStyle() and in this case the
correct resource file is located (sample_<style>.css).
But PackageResource#newResourceResponse uses
PackageResource#getResourceStream(), which does not take
Session.get().getStyle() into account and as a result locates the wrong
resource file (sample.css instead of sample_<style>.css), which is returned
to the browser. This seems to be a bug, isn't it? The same applies to the
locale.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Package-resource-location-does-not-consider-current-session-style-and-locale-tp4670338.html
Sent from the Users forum 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 resource location does not consider current session style and locale

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Please create a quickstart and attach it to a ticket in JIRA.
Thanks!

Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Apr 17, 2015 at 12:28 AM, Sergiy Barlabanov <
contact@sergiy-barlabanov.de> wrote:

> We are using Wicket 6.15 (but the code seems unchanged in the latest
> Wicket 6
> releases).
> We set style to Wicket session and expect Wicket to consider the style when
> loading CSS package resources. But this does not work.
> Seems to be some kind of inconsistency in PackageResource class.
> It uses PackageResource#getCacheableResourceStream() method to calculate
> the
> cache key of the resource (and the timestamp when generating the resource
> url). This method considers Session.get().getStyle() and in this case the
> correct resource file is located (sample_<style>.css).
> But PackageResource#newResourceResponse uses
> PackageResource#getResourceStream(), which does not take
> Session.get().getStyle() into account and as a result locates the wrong
> resource file (sample.css instead of sample_<style>.css), which is returned
> to the browser. This seems to be a bug, isn't it? The same applies to the
> locale.
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Package-resource-location-does-not-consider-current-session-style-and-locale-tp4670338.html
> Sent from the Users forum 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 resource location does not consider current session style and locale

Posted by Sergiy Barlabanov <co...@sergiy-barlabanov.de>.
Done.

https://issues.apache.org/jira/browse/WICKET-5909

sorry for delay.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Package-resource-location-does-not-consider-current-session-style-and-locale-tp4670338p4670823.html
Sent from the Users forum 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 resource location does not consider current session style and locale

Posted by Sven Meier <sv...@meiers.net>.
Please provide a quickstart and attach it to a new Jira issue.

Regards
Sven


On 16.04.2015 23:28, Sergiy Barlabanov wrote:
> We are using Wicket 6.15 (but the code seems unchanged in the latest Wicket 6
> releases).
> We set style to Wicket session and expect Wicket to consider the style when
> loading CSS package resources. But this does not work.
> Seems to be some kind of inconsistency in PackageResource class.
> It uses PackageResource#getCacheableResourceStream() method to calculate the
> cache key of the resource (and the timestamp when generating the resource
> url). This method considers Session.get().getStyle() and in this case the
> correct resource file is located (sample_<style>.css).
> But PackageResource#newResourceResponse uses
> PackageResource#getResourceStream(), which does not take
> Session.get().getStyle() into account and as a result locates the wrong
> resource file (sample.css instead of sample_<style>.css), which is returned
> to the browser. This seems to be a bug, isn't it? The same applies to the
> locale.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Package-resource-location-does-not-consider-current-session-style-and-locale-tp4670338.html
> Sent from the Users forum 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