Package org.apache.velocity.tools.view

Examples of org.apache.velocity.tools.view.VelocityView


     * {@link VelocityRenderer#isRenderable(String, org.apache.tiles.request.Request)}
     * .
     */
    @Test
    public void testIsRenderable() {
        VelocityView view = createMock(VelocityView.class);
        replay(view);
        Renderer renderer = new VelocityRenderer(view);
        assertTrue(renderer.isRenderable("/my/template.vm", null));
        assertFalse(renderer.isRenderable("my/template.vm", null));
        assertFalse(renderer.isRenderable("/my/template.jsp", null));
View Full Code Here


     * Creates the Velocity renderer.
     *
     * @return The Velocity renderer.
     */
    public VelocityRenderer build() {
        VelocityView velocityView = new VelocityView(
                new ApplicationContextJeeConfig(applicationContext, params));
        return new VelocityRenderer(velocityView);
    }
View Full Code Here

     * Commits the parameters and makes this renderer ready for the use.
     *
     * @since 2.2.0
     */
    public void commit() {
        velocityView = new VelocityView(new TilesApplicationContextJeeConfig());
    }
View Full Code Here


    protected void initializeView()
    {
        // get the VelocityView for this app
        VelocityView view =
            ServletUtils.getVelocityView(this.pageContext.getServletConfig());

        // now make a Context
        ViewToolContext context =
            new JspToolContext(view.getVelocityEngine(), this.pageContext);

        view.prepareToolboxes((HttpServletRequest)this.pageContext.getRequest());
        view.prepareContext(context);

        setVelocityView(view);
        setViewToolContext(context);
    }
View Full Code Here

    protected void renderContent(Writer out) throws Exception
    {
        if (getTemplate() != null)
        {
            VelocityView view = getVelocityView();
            ViewToolContext context = getViewToolContext();

            // get the actual Template
            Template template = view.getTemplate(getTemplate());

            if (getBodyContent() != null)
            {
                context.put(getBodyContentKey(), getRenderedBody());
            }
View Full Code Here


    protected void initializeView()
    {
        // get the VelocityView for this app
        VelocityView view =
            ServletUtils.getVelocityView(this.pageContext.getServletConfig());

        // now make a Context
        ViewToolContext context =
            new JspToolContext(view.getVelocityEngine(), this.pageContext);

        view.prepareContext(context, (HttpServletRequest)this.pageContext.getRequest());

        setVelocityView(view);
        setViewToolContext(context);
    }
View Full Code Here

    protected void renderContent(Writer out) throws Exception
    {
        if (getTemplate() != null)
        {
            VelocityView view = getVelocityView();
            ViewToolContext context = getViewToolContext();

            // get the actual Template
            Template template = view.getTemplate(getTemplate());

            if (getBodyContent() != null)
            {
                context.put(getBodyContentKey(), getRenderedBody());
            }
View Full Code Here

    @Override
    protected VelocityView getVelocityView()
    {
        if (this.view == null)
        {
            this.view = new VelocityView(getServletConfig());
        }
        return this.view;
    }
View Full Code Here

    @Override
    protected VelocityView getVelocityView()
    {
        if (this.view == null)
        {
            this.view = new VelocityView(getServletConfig());
        }
        return this.view;
    }
View Full Code Here

     * Commits the parameters and makes this renderer ready for the use.
     *
     * @since 2.2.0
     */
    public void commit() {
        velocityView = new VelocityView(new TilesApplicationContextJeeConfig());
    }
View Full Code Here

TOP

Related Classes of org.apache.velocity.tools.view.VelocityView

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.