Hello,

I'm trying to load statatic js files. I 'm using in the init of the application

getResourceSettings().addResourceFolder("/somePath/");
resourceSettings.setResourceStreamLocator(new RessourceLocator());

with
public class RessourceLocator extends ResourceStreamLocator{
public RessourceLocator() {}
public IResourceStream locate(final Class<?> clazz, final String path) {
        IResourceStream located = super.locate(clazz, trimFolders(path));
        if (located != null) {return located;}
        return super.locate(clazz, path);
}
    private String trimFolders(String path) {
        return path.substring(path.lastIndexOf("/") + 1);}
}

and in my Page I have
add(JavascriptPackageResource.getHeaderContribution("/myFile.js"));
and of course myFile.js located under /somePath"

what am I missing?

Yohan

Reply via email to