// FIXME: using TurbineJspService instead of the interface JspService
// because getRelativeTemplateName() is not defined in the
// interface. A patch has been submitted to Turbine.
TurbineJspService jsp = (TurbineJspService)TurbineServices.getInstance().getService(JspService.SERVICE_NAME);
// set the content type (including charset)
data.getResponse().setContentType(data.getContentType());
if (logger.isInfoEnabled() )
{
logger.info("JetspeedJspLayout: set response content type to " + data.getContentType());
}
// tell turbine that the response is handled by the JSP system.
data.declareDirectResponse();
// Put the path to the screen template into the request.
String path = TemplateLocator.locateScreenTemplate(data, data.getScreenTemplate());
if (path != null)
screenPath = jsp.getRelativeTemplateName("/screens" + path);
data.getRequest().setAttribute("screenJsp", screenPath);
if (logger.isInfoEnabled() )
{
logger.info("JetspeedJspLayout: set 'screenJSP' to: " + screenPath );
}
// Grab the layout template set in the JetspeedTemplatePage.
String templateName = data.getLayoutTemplate();
// Finally, generate the layout template and output to the response
if (logger.isInfoEnabled() )
{
logger.info("JetspeedJspLayout: forward request to: " + "/layouts" + templateName);
}
jsp.handleRequest(data, "/layouts" + templateName, false);
}