Remove call to FreeMarkerHttpServlet.getFreeMarkerComponentsForJsp from VitroHttpServlet, since was getting called more than once per request (since there are multiple servlets that are called for a single request). Use calls from the jsps instead.

This commit is contained in:
rjy7 2010-06-02 17:29:12 +00:00
parent 037ff45736
commit 55e68bb232
2 changed files with 1 additions and 8 deletions

View file

@ -64,14 +64,6 @@ public class VitroHttpServlet extends HttpServlet
request.getAttribute("webappDaoFactory") == null ){
log.warn("request scope was not prepared by VitroRequestPrep");
}
// TEMPORARY for transition from JSP to FreeMarker. Once transition
// is complete and no more pages are generated in JSP, this can be removed.
// Do this if FreeMarker is configured (i.e., not Datastar) and if we are not in
// a FreeMarkerHttpServlet, which will generate identity, menu, and footer from the page template.
if ( FreeMarkerHttpServlet.isConfigured() && !(this instanceof FreeMarkerHttpServlet) ) {
FreeMarkerHttpServlet.getFreeMarkerComponentsForJsp(request, response);
}
}

View file

@ -348,6 +348,7 @@ public class FreeMarkerHttpServlet extends VitroHttpServlet {
// a FreeMarkerHttpServlet, which will generate identity, menu, and footer from the page template.
// It's a static method because it needs to be called from JSPs that don't go through a servlet.
public static void getFreeMarkerComponentsForJsp(HttpServletRequest request, HttpServletResponse response) {
System.out.println("IN getFreeMarkerComponentsForJsp");
FreeMarkerComponentGenerator fcg = new FreeMarkerComponentGenerator(request, response);
request.setAttribute("ftl_identity", fcg.getIdentity());
request.setAttribute("ftl_menu", fcg.getMenu());