Link to an image in CSS using Wicket

For a great answer from another question, I started installing global resources (css / js / images) in init()my WebApplication method . Using the following:

mountSharedResource("/images/edit-btn.gif", new ResourceReference(GlobalResource.class, "edit-btn.gif").getSharedResourceKey());

This, of course, allows css in another package to do something like this:

background-image: url("/images/edit-btn.gif");

The problem I ran into is that it only works at runtime, the installed path is virtual. One of the great advantages of Wicket (imo) was the functions ( <wicket:remove>, xml valid tags, head links, page inheritance), which allowed the page designer working with the layout to render the page with its images, js, css, etc. without the need to run in the gate.

I completely agree that there is never a clear line between the roles of a designer / programmer in web applications, but it seems strange to me that Wicket designers have missed this. Is there a way to allow a universally used image to render autonomously, and also run-time in Wicket?

+3
source share
1 answer

, - html - , . - . script, - , webapp . , . , <wicket:remove>, .

+2

Source: https://habr.com/ru/post/1721362/


All Articles