return parameters;
}
private void sendSitemapResponse(HttpServletRequest request, HttpServletResponse response) throws IOException {
Settings settings = (Settings) this.beanFactory.getBean(Settings.class.getName());
// provide conditional GET relevant data and request method
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// read the 'If-Modified-Since' request header
long ifModifiedSince = request.getDateHeader("If-Modified-Since");
ResponseHeaderCollector.setIfLastModifiedSince(ifModifiedSince);
// read the 'If-None-Match' request header
String ifNoneMatch = request.getHeader("If-None-Match");
ResponseHeaderCollector.setIfNoneMatch(ifNoneMatch);
// request method
ResponseHeaderCollector.setRequestMethod(request.getMethod());
// invoke the sitemap engine
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ByteArrayOutputStream baos = new ByteArrayOutputStream(8192);
this.invoke(this.calcSitemapRequestURI(request), prepareParameters(request, response, settings,
this.servletContext), baos);
// read data after sitemap/pipeline execution
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// read the produced status code
int statusCode = ResponseHeaderCollector.getStatusCode();
// collect meta information from the previous exeuction of the sitemap engine
long lastModified = ResponseHeaderCollector.getLastModified();
String etag = ResponseHeaderCollector.getETag();
// set response headers
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (statusCode >= 200 && statusCode < 300) {
// send the ETag header
if (etag != null && !"".equals(etag)) {
response.setHeader("ETag", etag);
}
// send the Last-Modified
if (lastModified > -1) {
response.setDateHeader("Last-Modified", lastModified);
}
}
// set the X-Cocoon-Version header
if (!"false".equals(settings.getProperty("org.apache.cocoon.show-version"))) {
response.setHeader("X-Cocoon-Version", this.version);
}
// Content-Type handling
String mimeType = ResponseHeaderCollector.getMimeType();