/** * Create a Velocity Context instance for the given model, * to be passed to the template for merging. * <p>The default implementation delegates to {@link #createVelocityContext(Map)}. * Can be overridden for a special context class, for example ChainedContext which * is part of the view package of Velocity Tools. ChainedContext is needed for * initialization of ViewTool instances. * <p>Have a look at {@link VelocityToolboxView}, which pre-implements * ChainedContext support. This is not part of the standard VelocityView class * in order to avoid a required dependency on the view package of Velocity Tools. * @param model the model Map, containing the model attributes to be exposed to the view * @param request current HTTP request * @param response current HTTP response * @return the Velocity Context * @throws Exception if there's a fatal error while creating the context * @see #createVelocityContext(Map) * @see #initTool * @see org.apache.velocity.tools.view.context.ChainedContext * @see VelocityToolboxView */ protected Context createVelocityContext( Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { return createVelocityContext(model); }
/** * Create a Velocity Context instance for the given model, * to be passed to the template for merging. * <p>The default implementation delegates to {@link #createVelocityContext(Map)}. * Can be overridden for a special context class, for example ChainedContext which * is part of the view package of Velocity Tools. ChainedContext is needed for * initialization of ViewTool instances. * <p>Have a look at {@link VelocityToolboxView}, which pre-implements * ChainedContext support. This is not part of the standard VelocityView class * in order to avoid a required dependency on the view package of Velocity Tools. * @param model the model Map, containing the model attributes to be exposed to the view * @param request current HTTP request * @param response current HTTP response * @return the Velocity Context * @throws Exception if there's a fatal error while creating the context * @see #createVelocityContext(Map) * @see #initTool * @see org.apache.velocity.tools.view.context.ChainedContext * @see VelocityToolboxView */ protected Context createVelocityContext( Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { return createVelocityContext(model); }
/** * Create a Velocity Context instance for the given model, * to be passed to the template for merging. * <p>The default implementation delegates to {@link #createVelocityContext(Map)}. * Can be overridden for a special context class, for example ChainedContext which * is part of the view package of Velocity Tools. ChainedContext is needed for * initialization of ViewTool instances. * <p>Have a look at {@link VelocityToolboxView}, which pre-implements * ChainedContext support. This is not part of the standard VelocityView class * in order to avoid a required dependency on the view package of Velocity Tools. * @param model the model Map, containing the model attributes to be exposed to the view * @param request current HTTP request * @param response current HTTP response * @return the Velocity Context * @throws Exception if there's a fatal error while creating the context * @see #createVelocityContext(Map) * @see #initTool * @see org.apache.velocity.tools.view.context.ChainedContext * @see VelocityToolboxView */ protected Context createVelocityContext( Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { return createVelocityContext(model); }
/** * 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); }
/** * 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); }
/** * 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); }