org.apache.tiles.request.velocity.render

## Class VelocityRenderer

- java.lang.Object
- - org.apache.tiles.request.velocity.render.VelocityRenderer

- All Implemented Interfaces:
    Renderer

      public class VelocityRenderer
      extends Object
      implements Renderer

  Attribute renderer for rendering Velocity templates as attributes. It is available only to Servlet-based environment. It uses VelocityView to render the response. To initialize it correctly, call #setParameter(String, String) for all the parameters that you want to set, and then call #commit().

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `VelocityRenderer(org.apache.velocity.tools.view.VelocityView velocityView)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isRenderable(String path, Request request)` Checks if this renderer can render a path.
    `void` | `render(String path, Request request)` Renders a path.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### VelocityRenderer

          public VelocityRenderer(org.apache.velocity.tools.view.VelocityView velocityView)

      Constructor.
      Parameters:
        `velocityView` - The Velocity view manager.

  - ### Method Detail

    - #### render

          public void render(String path,
                             Request request)
                      throws IOException

      Description copied from interface: `Renderer`
      Renders a path.
      Specified by:
        `render` in interface `Renderer`
      Parameters:
        `path` - The path to render.
        `request` - The Tiles request context.
      Throws:
        `IOException` - If something goes wrong during rendition.

    - #### isRenderable

          public boolean isRenderable(String path,
                                      Request request)

      Description copied from interface: `Renderer`
      Checks if this renderer can render a path. Note that this does not mean it is the best renderer available, but checks only its capability.
      Specified by:
        `isRenderable` in interface `Renderer`
      Parameters:
        `path` - The path to be rendered.
        `request` - The request context.
      Returns:
        `true` if this renderer can render the attribute.

Copyright © 2000–2025 Apache Software Foundation. All rights reserved.