wicket-bootstrap icon indicating copy to clipboard operation
wicket-bootstrap copied to clipboard

Exception when loading webjar resources with leading slash

Open reckart opened this issue 7 years ago • 0 comments

When trying to load the css/google-bootstrap.less that ships in Wicket Bootstrap via a LessResourceReference, e.g.

IBootstrapSettings settings = Bootstrap.getSettings(this);
settings.setCssResourceReference(new LessResourceReference(GoogleCssReference.class, "css/google-bootstrap.less"));

this exception is triggered:

WebJarAssetLocator$ResourceException: /webjars//bootstrap/null/less/mixins.less could not be found. Make sure you've added the corresponding WebJar and please check for typos.

The reason appears to be the leading slash here:

@import "webjars!/bootstrap/current/less/mixins.less

This causes the recent-version substitution to fail because at some point it causes the slash to be doubled and /webjars//bootstrap/curent/less/mixins.less cannot be found in the asset map.

Either the doubling of the slash should be avoided or an exception should be thrown that leading slashes are not supported at all.

reckart avatar Aug 02 '17 22:08 reckart