Ejemplo n.º 1
0
 private View createGroovyPageView(GrailsWebRequest webRequest, String gspView) {
   if (LOG.isDebugEnabled()) {
     LOG.debug("Resolved GSP view at URI [" + gspView + "]");
   }
   GroovyPageView gspSpringView = new GroovyPageView();
   gspSpringView.setServletContext(webRequest.getServletContext());
   gspSpringView.setUrl(gspView);
   gspSpringView.setApplicationContext(getApplicationContext());
   gspSpringView.setTemplateEngine(templateEngine);
   return gspSpringView;
 }
 private View createGroovyPageView(String gspView, ScriptSource scriptSource) {
   if (LOG.isDebugEnabled()) {
     LOG.debug("Resolved GSP view at URI [" + gspView + "]");
   }
   GroovyPageView gspSpringView = new GroovyPageView();
   gspSpringView.setServletContext(getServletContext());
   gspSpringView.setUrl(gspView);
   gspSpringView.setApplicationContext(getApplicationContext());
   gspSpringView.setTemplateEngine(templateEngine);
   gspSpringView.setScriptSource(scriptSource);
   try {
     gspSpringView.afterPropertiesSet();
   } catch (Exception e) {
     throw new RuntimeException("Error initializing GroovyPageView", e);
   }
   return gspSpringView;
 }