Package org.apache.velocity.tools.view.context

Examples of org.apache.velocity.tools.view.context.ChainedContext


                                            HttpServletResponse response)
    {
        ViewToolContext ctx;
        if (this.deprecationSupportMode)
        {
            ctx = new ChainedContext(velocity, request, response, servletContext);
        }
        else
        {
            ctx = new ViewToolContext(velocity, request, response, servletContext);
        }
View Full Code Here


                LOG.debug("internal toolbox context ignored");
            }
        }

        if (toolboxManager != null && ctx != null) {
            ChainedContext chained = new ChainedContext(context, velocityEngine, req, res, ctx);
            chained.setToolbox(toolboxManager.getToolbox(chained));
            result = chained;
        } else {
            result = context;
        }
View Full Code Here

                                            HttpServletResponse response)
    {
        ViewToolContext ctx;
        if (this.deprecationSupportMode)
        {
            ctx = new ChainedContext(velocity, request, response, servletContext);
        }
        else
        {
            ctx = new ViewToolContext(velocity, request, response, servletContext);
        }
View Full Code Here

            // in case this was used outside the lifecycle of struts servlet
            LOG.debug("internal toolbox context ignored");
        }

        if (toolboxManager != null && ctx != null) {
            ChainedContext chained = new ChainedContext(context, velocityEngine, req, res, ctx);
            chained.setToolbox(toolboxManager.getToolbox(chained));
            result = chained;
        } else {
            result = context;
        }
View Full Code Here

            toolboxManager = ServletToolboxManager.getInstance(servletContext, file);
            servletContext.setAttribute(TOOLBOX_MANAGER_KEY, toolboxManager);
        }
       
        // load a toolbox context
        ChainedContext chainedContext =
                new ChainedContext(ctx, request, response, servletContext);
        ToolboxContext toolboxContext =
                toolboxManager.getToolboxContext(chainedContext);
       
        if (toolboxContext != null) {
            // add MessageTool to VelocityContext
View Full Code Here

            // in case this was used outside the lifecycle of struts servlet
            log.debug("internal toolbox context ignored");
        }

        if (toolboxManager != null && ctx != null) {
            ChainedContext chained = new ChainedContext(context, req, res, ctx);
            chained.setToolbox(toolboxManager.getToolboxContext(chained));
            return chained;
        } else {
            return context;
        }
View Full Code Here

  @Override
  protected Context createVelocityContext(
      Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {

    // Create a ChainedContext instance.
    ChainedContext velocityContext = new ChainedContext(
        new VelocityContext(model), getVelocityEngine(), request, response, getServletContext());

    // Load a Velocity Tools toolbox, if necessary.
    if (getToolboxConfigLocation() != null) {
      ToolboxManager toolboxManager = ServletToolboxManager.getInstance(
          getServletContext(), getToolboxConfigLocation());
      Map toolboxContext = toolboxManager.getToolbox(velocityContext);
      velocityContext.setToolbox(toolboxContext);
    }

    return velocityContext;
  }
View Full Code Here

   */
  protected Context createVelocityContext(
      Map model, HttpServletRequest request, HttpServletResponse response) throws Exception {

    // Create a ChainedContext instance.
    ChainedContext velocityContext = new ChainedContext(
        new VelocityContext(model), getVelocityEngine(), request, response, getServletContext());

    // Load a Velocity Tools toolbox, if necessary.
    if (getToolboxConfigLocation() != null) {
      ToolboxManager toolboxManager = ServletToolboxManager.getInstance(
          getServletContext(), getToolboxConfigLocation());
      Map toolboxContext = toolboxManager.getToolbox(velocityContext);
      velocityContext.setToolbox(toolboxContext);
    }

    return velocityContext;
  }
View Full Code Here

            // in case this was used outside the lifecycle of struts servlet
            LOG.debug("internal toolbox context ignored");
        }

        if (toolboxManager != null && ctx != null) {
            ChainedContext chained = new ChainedContext(context, req, res, ctx);
            chained.setToolbox(toolboxManager.getToolbox(chained));
            return chained;
        } else {
            return context;
        }
View Full Code Here

            // in case this was used outside the lifecycle of struts servlet
            LOG.debug("internal toolbox context ignored");
        }

        if (toolboxManager != null && ctx != null) {
            ChainedContext chained = new ChainedContext(context, velocityEngine, req, res, ctx);
            chained.setToolbox(toolboxManager.getToolbox(chained));
            return chained;
        } else {
            return context;
        }
View Full Code Here

TOP

Related Classes of org.apache.velocity.tools.view.context.ChainedContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.