You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Marcel Hoerr <Ma...@gmx.de> on 2013/10/02 11:05:52 UTC

Question regarding ResourceBundles and relative paths

hi wicket community!

i have a question regarding the usage of ResourceBundles. consider the following use case:
i want to add a ResourceBundle in my wicketapplication class with a css file (and some relative paths to images/fonts in it). right now i add the ResourceBundle with application scope.
all relative paths in the css file are not resolved from their scope but from application scope (which leads to ClassNotFoundExceptions). is this expected behavior?

i'm using wicket 6.10.

best regards

marcel

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


Re: Question regarding ResourceBundles and relative paths

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

The method signature is:
ResourceBundles#addCssBundle(Class<?> scope, String
name, CssResourceReference... references)

I.e. the 'scope' is uses as ... as scope.
So you can use any Class that will fit your needs.

com.example
  - MyClass
  - res/css/{a,b,c}.css
  - res/images/{d,e,f}.png

then use addCssBundle(MyClass.class, "bundle.css", references)



On Wed, Oct 2, 2013 at 11:05 AM, Marcel Hoerr <Ma...@gmx.de> wrote:

> hi wicket community!
>
> i have a question regarding the usage of ResourceBundles. consider the
> following use case:
> i want to add a ResourceBundle in my wicketapplication class with a css
> file (and some relative paths to images/fonts in it). right now i add the
> ResourceBundle with application scope.
> all relative paths in the css file are not resolved from their scope but
> from application scope (which leads to ClassNotFoundExceptions). is this
> expected behavior?
>
> i'm using wicket 6.10.
>
> best regards
>
> marcel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>