Hi,I have my markups in another folder and am mounting static pages via a
generic template (so I don't have to use a new class for every static page).
The Static pages are in a Common template, that uses a common menu to
navigate and uses <wicket:link> to get the correct link from Wicket.
Works great; except I see the following in the log, which concerns me. I'd
like to suppress the cause of the log:
WARN - AutoLinkResolver - Did not find corresponding java class:
com.mysite.site.pages.templates.static_page_name
Code:
======
In my extension of "WebApplication.init()" I have:
mount(new MixedParamUrlCodingStrategy(
"/static", GenericStaticPage.class, new
String[]{"pageId"} ));
I also have getResourceSettings().setResourceStreamLocator with the
following:
(to direct the location to the markup files: standard stuff)
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 derivedPath = "/html" +
path.replaceFirst("com/mysite/site/pages", ""); //TODO: Cleanup!
try {
URL url = sc.getResource(derivedPath);
if (url != null) {
log.debug("[getFileResourceStreamLocator.locate]
derivedPath = " + derivedPath);
return new UrlResourceStream(url);
}
} catch(MalformedURLException e) { }
log.debug("[getFileResourceStreamLocator.locate] default
path = " + path);
return defaultLocator.locate(clazz, path); //Use default
locator
}
};
}
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/AutoLinkResolver-WARNINGS-tp2332181p2332181.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]