this.inServletServiceFramework = CallStack.getCurrentFrame() != null;
}
private void initializeSitemap() throws SitemapNotFoundException, SitemapInitializationException {
URL url = null;
SitemapBuilder sitemapBuilder = null;
try {
sitemapBuilder = (SitemapBuilder) this.beanFactory.getBean(SitemapBuilder.class.getName());
url = this.servletContext.getResource(this.getSitemapPath());
} catch (Exception e) {
throw new SitemapInitializationException("Can't initialize sitemap.", e);
}
// if the sitemap URL can't be resolved by the ServletContext, null is returned
if (url == null) {
// prepare a meaningful exception
String baseURL = this.getBaseURL().toExternalForm();
if (baseURL.endsWith("/")) {
baseURL = baseURL.substring(0, baseURL.length() - 1);
}
throw new SitemapNotFoundException("Can't find sitemap at " + baseURL + this.getSitemapPath());
}
this.sitemapNode = sitemapBuilder.build(url);
}