You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by nino martinez wael <ni...@gmail.com> on 2016/04/01 08:34:14 UTC

[7.2] ContextRelativeResourceReference

I am having a hard time getting the ContextRelativeResourceReference to work.

I thought it was supposed to grab the specified resource from the web
container relative to where the wicketapplication where mounted.

In my case my directory layout are like the attached image.

And I have configured jetty like this:

        // Static resources
        String staticPath = "src/main/webapp/";
        ServletHolder resourceServlet = new ServletHolder(DefaultServlet.class);
        resourceServlet.setInitParameter("dirAllowed", "true");
        resourceServlet.setInitParameter("resourceBase", staticPath);
        resourceServlet.setInitParameter("pathInfoOnly", "true");

        sch.addServlet(resourceServlet, "/webdialer/*");

I have also tried without the "webdialer" part, and the leading slash.
Jetty does server the resources just fine.

I am using the config:

ContextRelativeResourceReference("css/lavish-bootstrap.css")

Here are the error I am getting:

Last cause: The requested resource was not found: /css/lavish-bootstrap.css
WicketMessage: org.apache.wicket.util.resource.ResourceStreamNotFoundException:
The requested resource was not found: /css/lavish-bootstrap.css



-- 
Best regards / Med venlig hilsen
Nino Martinez