* This method sets up the template cache.
*/
private void initJsp() throws Exception
{
ServletContext context = TurbineServlet.getServletContext();
Configuration config = getConfiguration();
/*
* Use the turbine template service to translate
* the template paths.
*/
templatePaths = TurbineTemplate.translateTemplatePaths(
config.getStringArray("templates"));
/*
* Set relative paths from config.
* Needed for javax.servlet.RequestDispatcher
*/
relativeTemplatePaths = config.getStringArray("templates");
/*
* Make sure that the relative paths begin with /
*/
for (int i = 0; i < relativeTemplatePaths.length; i++)
{
if (!relativeTemplatePaths[i].startsWith("/"))
{
relativeTemplatePaths[i] = "/" + relativeTemplatePaths[i];
}
}
bufferSize = config.getInt("buffer.size", 8192);
/*
* Register with the template service.
*/
registerConfiguration("jsp");