Well, I solved the problem as follows:
private void mountResources(Class clazz, String directory) { java.net.URL url = clazz.getResource(clazz.getSimpleName() + ".class"); File[] files = new File(url.getPath()).getParentFile().listFiles(); for (int i=0; i< files.length; i++) { String fileName = files[i].getName(); if (!fileName.endsWith("class")) { mountSharedResource("/" + directory + "/" + fileName, new ResourceReference(clazz, fileName).getSharedResourceKey()); } } }
And using it like this:
mountResources(ImagesScope.class, "images"); mountResources(FontsScope.class, "fonts"); mountResources(JsScope.class, "js");
But it is unbelievable that Wicket does not support him in any way internally. I'm very surprised. To install pages with a bookmark for the entire package, we mount (path, package name), but nothing for resources (if I understand correctly).
source share