For your information: I implemented a better solution with
http://www.webjars.org today.
> <dependency>
> <groupId>de.agilecoders.wicket.webjars</groupId>
> <artifactId>wicket-webjars</artifactId>
> <version>0.5.3</version>
> </dependency>
> <dependency>
> <groupId>org.webjars</groupId>
> <artifactId>bootstrap</artifactId>
> <version>3.3.5</version>
> </dependency>
If WebjarsCssResourceReference is used, the problem of the Glyphicons
fonts is solved.
Dieter
Am 07.10.2015 um 10:12 schrieb Dieter Tremel:
> Hello list,
>
> Using Bootstrap 3.3.5 I want to include the stylesheet, js and font
> resources myself, not using wicket-bootstrap. To have a dependency to
> wicket's jquery version I decided to move resource handling from html to
> java and to use ContextRelativeResourceReference like this:
>
>> ContextRelativeResourceReference bootstrapCSS = new
>> ContextRelativeResourceReference("css/bootstrap.css");
>> response.render(CssHeaderItem.forReference(bootstrapCSS));
>> ...
>
> When using gylphicons the icons are not rendered correctly, a 404 error
> is given for the fonts and the log says
>> 09:45:37.976 [http-nio-8084-exec-6] WARN
>> o.a.w.r.r.ResourceReferenceRegistry - A ResourceReference wont be created
>> for a resource with key [scope: org.apache.wicket.Application; name:
>> fonts/glyphicons-halflings-regular.ttf; locale: null; style: null;
>> variation: null] because it cannot be located.
>
> The fonts are defined in bootstrap.css with paths relative to css folder
> like this
>> @font-face {
>> font-family: 'Glyphicons Halflings';
>>
>> src: url('../fonts/glyphicons-halflings-regular.eot');
>> src: url('../fonts/glyphicons-halflings-regular.eot?#iefix')
>> format('embedded-opentype'),
>> url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'),
>> url('../fonts/glyphicons-halflings-regular.woff') format('woff'),
>> url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),
>> url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular')
>> format('svg');
>> }
>
> Of course the fonts exist at /src/main/webapp/fonts (sibling of folder
> css) and are in the war file at /fonts.
>
> I tried to use
> getResourceSettings().setCssCompressor(new CssUrlReplacer());
> in my WebApplication#init but with no difference, the errors are still
> there.
>
> What is the correct way of resource handling at java side?
>
> Thank You
> Dieter Tremel
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]