@Override protected void postProcessVelocityEngine(VelocityEngine velocityEngine) { super.postProcessVelocityEngine(velocityEngine); velocityEngine.setProperty(ROSE_MACRO_RESOURCE_LOADER_CLASS, ClasspathResourceLoader.class .getName()); velocityEngine.addProperty(VelocityEngine.RESOURCE_LOADER, ROSE_MACRO_RESOURCE_LOADER_NAME); velocityEngine.addProperty(VelocityEngine.VM_LIBRARY, ROSE_MACRO_LIBRARY); if (logger.isInfoEnabled()) { logger.info("ClasspathResourceLoader with name '" + ROSE_MACRO_RESOURCE_LOADER_NAME + "' added to configured VelocityEngine"); } } }
@Override public void setToolboxConfigLocation(String toolboxConfigLocation) { super.setToolboxConfigLocation(toolboxConfigLocation); this.toolboxConfigLocation = toolboxConfigLocation; }
@Override protected AbstractUrlBasedView buildView(String viewName) throws Exception { VelocityLayoutView view = (VelocityLayoutView) super.buildView(viewName); // Use not-null checks to preserve VelocityLayoutView's defaults. if (this.layoutUrl != null) { view.setLayoutUrl(this.layoutUrl); } if (this.layoutKey != null) { view.setLayoutKey(this.layoutKey); } if (this.screenContentKey != null) { view.setScreenContentKey(this.screenContentKey); } return view; }
/** * Process the model map by merging it with the Velocity template. * Output is directed to the servlet response. * <p>This method can be overridden if custom behavior is needed. */ @Override protected void renderMergedTemplateModel( Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { exposeHelpers(model, request); Context velocityContext = createVelocityContext(model, request, response); exposeHelpers(velocityContext, request, response); exposeToolAttributes(velocityContext, request); doRender(velocityContext, response); }
@Override protected AbstractUrlBasedView buildView(String viewName) throws Exception { VelocityView view = (VelocityView) super.buildView(viewName); view.setDateToolAttribute(this.dateToolAttribute); view.setNumberToolAttribute(this.numberToolAttribute); if (this.toolboxConfigLocation != null) { ((VelocityToolboxView) view).setToolboxConfigLocation(this.toolboxConfigLocation); } return view; }
public VelocityViewResolver() { setViewClass(requiredViewClass()); }
@Bean public VelocityConfigurer velocityConfig() { VelocityConfigurer velocityConfigurer = new VelocityConfigurer(); velocityConfigurer.setResourceLoaderPath("/WEB-INF/velocity/"); return velocityConfigurer; }
/** * Initialize VelocityEngineFactory's VelocityEngine * if not overridden by a pre-configured VelocityEngine. * @see #createVelocityEngine * @see #setVelocityEngine */ @Override public void afterPropertiesSet() throws IOException, VelocityException { if (this.velocityEngine == null) { this.velocityEngine = createVelocityEngine(); } }
@Override public void setToolboxConfigLocation(String toolboxConfigLocation) { super.setToolboxConfigLocation(toolboxConfigLocation); this.toolboxConfigLocation = toolboxConfigLocation; }
@Override protected AbstractUrlBasedView buildView(String viewName) throws Exception { VelocityLayoutView view = (VelocityLayoutView) super.buildView(viewName); // Use not-null checks to preserve VelocityLayoutView's defaults. if (this.layoutUrl != null) { view.setLayoutUrl(this.layoutUrl); } if (this.layoutKey != null) { view.setLayoutKey(this.layoutKey); } if (this.screenContentKey != null) { view.setScreenContentKey(this.screenContentKey); } return view; }
/** * Process the model map by merging it with the Velocity template. * Output is directed to the servlet response. * <p>This method can be overridden if custom behavior is needed. */ @Override protected void renderMergedTemplateModel( Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { exposeHelpers(model, request); Context velocityContext = createVelocityContext(model, request, response); exposeHelpers(velocityContext, request, response); exposeToolAttributes(velocityContext, request); doRender(velocityContext, response); }
@Override protected AbstractUrlBasedView buildView(String viewName) throws Exception { VelocityView view = (VelocityView) super.buildView(viewName); view.setDateToolAttribute(this.dateToolAttribute); view.setNumberToolAttribute(this.numberToolAttribute); if (this.toolboxConfigLocation != null) { ((VelocityToolboxView) view).setToolboxConfigLocation(this.toolboxConfigLocation); } return view; }
public VelocityViewResolver() { setViewClass(requiredViewClass()); }
/** * Initialize VelocityEngineFactory's VelocityEngine * if not overridden by a pre-configured VelocityEngine. * @see #createVelocityEngine * @see #setVelocityEngine */ @Override public void afterPropertiesSet() throws IOException { if (this.velocityEngine == null) { this.velocityEngine = createVelocityEngine(); } }
@Override public void setToolboxConfigLocation(String toolboxConfigLocation) { super.setToolboxConfigLocation(toolboxConfigLocation); this.toolboxConfigLocation = toolboxConfigLocation; }
@Override public void setToolboxConfigLocation(String toolboxConfigLocation) { super.setToolboxConfigLocation(toolboxConfigLocation); this.toolboxConfigLocation = toolboxConfigLocation; }
@Override protected AbstractUrlBasedView buildView(String viewName) throws Exception { VelocityLayoutView view = (VelocityLayoutView) super.buildView(viewName); // Use not-null checks to preserve VelocityLayoutView's defaults. if (this.layoutUrl != null) { view.setLayoutUrl(this.layoutUrl); } if (this.layoutKey != null) { view.setLayoutKey(this.layoutKey); } if (this.screenContentKey != null) { view.setScreenContentKey(this.screenContentKey); } return view; }
@Override protected AbstractUrlBasedView buildView(String viewName) throws Exception { VelocityView view = (VelocityView) super.buildView(viewName); view.setDateToolAttribute(this.dateToolAttribute); view.setNumberToolAttribute(this.numberToolAttribute); if (this.toolboxConfigLocation != null) { ((VelocityToolboxView) view).setToolboxConfigLocation(this.toolboxConfigLocation); } return view; }
public VelocityViewResolver() { setViewClass(requiredViewClass()); }
/** * Initialize VelocityEngineFactory's VelocityEngine * if not overridden by a pre-configured VelocityEngine. * @see #createVelocityEngine * @see #setVelocityEngine */ @Override public void afterPropertiesSet() throws IOException, VelocityException { if (this.velocityEngine == null) { this.velocityEngine = createVelocityEngine(); } }