Ernest, Igor --> thanks!
I had gone to that wiki earlier; I only focussed on the section that talked
about Wicket 1.3 (which only allows to change location in Classpath) so I
missed the point. I saw 1.2 and modified the code to pick up any file from
the ServletContext; and it works with the code as follows:
public ResourceStreamLocator getFileResourceStreamLocator(final
ServletContext sc) {
final IResourceStreamLocator defaultLocator =
super.getResourceSettings().getResourceStreamLocator();
return new ResourceStreamLocator(){
@Override
public IResourceStream locate(final Class<?> clazz, final String
path) {
String fullPath = "/html" + path.replaceFirst("<Your
base package
name for WebPage components>", ""); //TODO: Cleanup!
log.debug("[getFileResourceStreamLocator.locate] fullPath =
" + fullPath);
try {
final URL url = sc.getResource(fullPath);
if (url != null) {
return new UrlResourceStream(url);
}
} catch(MalformedURLException e) { }
return defaultLocator.locate(clazz, path); //Use default
locator
}
};
}
....I also had a typo in the package name of my templates :) :p
(I'm using Markup inheritance; so my templates are put in another package.
Due to the typo of that package name, Wicket was unable to locate the
templates and causing issues).
All fixed. Thanks to your posts I went back and realized my mistakes.
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/How-to-override-container-markup-package-loaction-tp2274647p2278053.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]