io.vertx.ext.web.handler

## Interface TemplateHandler

- All Superinterfaces:
    Handler<RoutingContext>

      public interface TemplateHandler
      extends Handler<RoutingContext>

  A handler which renders responses using a template engine and where the template name is selected from the URI path.
  Author:
    Tim Fox

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_CONTENT_TYPE` The default content type header to be used in the response
    `static String` | `DEFAULT_INDEX_TEMPLATE` The default index page
    `static String` | `DEFAULT_TEMPLATE_DIRECTORY` The default directory where templates will be looked for

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TemplateHandler` | `create(TemplateEngine engine)` Create a handler
    `static TemplateHandler` | `create(TemplateEngine engine, String templateDirectory, String contentType)` Create a handler
    `TemplateHandler` | `setIndexTemplate(String indexTemplate)` Set the index template

    - ### Methods inherited from interface io.vertx.core.Handler

      `handle`

- - ### Field Detail

    - #### DEFAULT_TEMPLATE_DIRECTORY

          static final String DEFAULT_TEMPLATE_DIRECTORY

      The default directory where templates will be looked for
      See Also:
        Constant Field Values

    - #### DEFAULT_CONTENT_TYPE

          static final String DEFAULT_CONTENT_TYPE

      The default content type header to be used in the response
      See Also:
        Constant Field Values

    - #### DEFAULT_INDEX_TEMPLATE

          static final String DEFAULT_INDEX_TEMPLATE

      The default index page
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### setIndexTemplate

          TemplateHandler setIndexTemplate(String indexTemplate)

      Set the index template
      Parameters:
        `indexTemplate` - the index template
      Returns:
        a reference to this, so the API can be used fluently

    - #### create

          static TemplateHandler create(TemplateEngine engine)

      Create a handler
      Parameters:
        `engine` - the template engine
      Returns:
        the handler

    - #### create

          static TemplateHandler create(TemplateEngine engine,
                                        String templateDirectory,
                                        String contentType)

      Create a handler
      Parameters:
        `engine` - the template engine
        `templateDirectory` - the template directory where templates will be looked for
        `contentType` - the content type header to be used in the response
      Returns:
        the handler

Copyright © 2024 Eclipse. All rights reserved.