[ 
https://issues.apache.org/jira/browse/WICKET-5909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14550856#comment-14550856
 ] 

Tobias Soloschenko commented on WICKET-5909:
--------------------------------------------

The issue here is that if you mount a resource it gets a fixed count of url 
segments like you put into the first arg of mountResource. For a normal 
ResourceReference the style is added as query behind as query and resolves 
directly to the resource - to test (not mounted ResourceReference)

This will give you the orange css
./wicket/resource/org.barlabanov.HomePage/styled-ver-1432053148000.css?-orange

This will give you the blue
./wicket/resource/org.barlabanov.HomePage/styled-ver-1432053148000.css

If you mount that ResourceReference a ResourceMapper is initialized at the 
startup of the application which takes delegates the requests of the mount to 
the ResourceReference, but at this point there is no session to get the style 
from and if it would be there the style is not redirected to the actual 
ResourceReference.

I tried to modify the ResourceMapper, but without any success.

@[~bitstorm] What do you think? I don't think it has something to do with 
https://issues.apache.org/jira/browse/WICKET-5793 - but correct me if I am 
wrong.

> Session style is not taken into account when loading mounted resources.
> -----------------------------------------------------------------------
>
>                 Key: WICKET-5909
>                 URL: https://issues.apache.org/jira/browse/WICKET-5909
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.19.0
>            Reporter: Sergiy Barlabanov
>         Attachments: style-bug.zip
>
>
> Session#getStyle is not considered when a mounted package resource is loaded. 
> Wicket loads the default one.
> If the resource is not mounted, everything works fine and Wicket delivers the 
> correct resource file.
> Quickstart is attached. There are two CSS files: styled.css and 
> styled_orange.css. The corresponding package resource is mounted. The session 
> style is set to orange in WicketApplication#newSession. Expected behavior is 
> that styled_orange.css is delivered to a browser. Instead styled.css is 
> delivered.
> There is a workaround: see WorkaroundResourceStreamLocator.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to