// pass the request object to the producer and produce the initial
// Document
if (PROFILE) profiler.startEvent (requestMarker, producer.getClass ());
Document document = producer.getDocument(request);
if (PROFILE) profiler.finishEvent (requestMarker, producer.getClass ());
if (((HttpServletResponseFacade) response).hasRedirected) throw new RedirectException ();
if (LOG) logger.log(this, "Document produced", Logger.DEBUG);
// See if disable caching processing instruction exists
if (Utils.getFirstPI (document, DISABLE_CACHING_PI, true) != null) {
page.setChangeable (UNCACHEABLE);
}
// pass needed parameters to the processor pipeline
Hashtable environment = new Hashtable();
environment.put("path", producer.getPath(request));
environment.put("browser", browsers.map(agent));
environment.put("request", request);
environment.put("response", response);
if (servletContext != null) environment.put("context", servletContext);
// process the document through the document processors
for (int processNum = 0; true; processNum++) {
Processor processor = processors.getProcessor(document);
if (processor == null) break;
String processDesc = processor.getClass ().getName () + "-" + processNum;
if (PROFILE) profiler.startEvent (requestMarker, processDesc);
document = processor.process(document, environment);
page.setChangeable(processor);
if (PROFILE) profiler.finishEvent (requestMarker, processDesc);
if (((HttpServletResponseFacade) response).hasRedirected) throw new RedirectException ();
if (LOG) logger.log(this, "Document processed", Logger.DEBUG);
}
// get the right formatter for the page
Formatter formatter = formatters.getFormatter(document);