Hi,

Instead of dealing with response decorators you could
use org.apache.wicket.markup.html.IHeaderContributor

getHeaderContributorListeners().add( return response -> {
        response.render(CssHeaderItem.forReference(css1));
        response.render(CssHeaderItem.forReference(css2));
})

IHeaderResponseDecorator is more powerful. It should be used when you want
to intercept all header contributions and add/modify/remove contributions.

On Wed, Sep 8, 2021 at 6:47 AM Arunachalam Sibisakkaravarthi <
arunacha...@mcruncher.com> wrote:

> Hi guys,
> I am doing Wicket migration from 7.x to 9.x
> In Wicket7.x I add css resource as below, it was working
>
> getHeaderResponseDecorators().add(getHeaderResponseDecorator());
>
> private IHeaderResponseDecorator getHeaderResponseDecorator()
> {
>     return response -> {
>         response.render(CssHeaderItem.forReference(css1));
>
>         response.render(CssHeaderItem.forReference(css2));
>
> return new JavaScriptFilteredIntoFooterHeaderResponse(response, "scripts");
> };
>
> whereas the above one doesn't work in Wicket9.x
> Is there any alternative to css and js in init() method of WebApplication?
> so that css/js will be available to all components.
>
>
>
> *Thanks And RegardsSibi.ArunachalammCruncher*
>

Reply via email to