THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
public class PathStripperLocator extends ResourceStreamLocator { public PathStripperLocator() { } public IResourceStream locate(final Class clazz, final String path) { returnIResourceStream located = super.locate(clazz, trimFolders(path)); } privateif String trimFolders(Stringlocated path) { if (path.startsWith("org/apache/wicket")!= null) { return pathlocated; } return pathsuper.substringlocate(path.lastIndexOf("/") + 1clazz, path); } } |
or perhaps:
Code Block |
---|
... private String trimFolders(String path) { if (path.startsWith("org/apache/wicket") && !path.matches("org/apache/wicket/Application.*properties")) { return path; } return path.substring(path.lastIndexOf("/") + 1); } ...} |
Secondly, override Application.init() method to add the new IResourceStreamLocator:
...