org.apache.tiles.template

## Class DefinitionModel

- java.lang.Object
- - org.apache.tiles.template.DefinitionModel

-     public class DefinitionModel
      extends Object

  Create a definition at runtime.

  Create a new definition at runtime. Newly created definition will be available across the entire request.

  Since:
    2.2.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefinitionModel()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `execute(String name, String template, String role, String extendsParam, String preparer, Request request, ModelBody modelBody)` Executes the operation.

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

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

- - ### Constructor Detail

    - #### DefinitionModel

          public DefinitionModel()

  - ### Method Detail

    - #### execute

          public void execute(String name,
                              String template,
                              String role,
                              String extendsParam,
                              String preparer,
                              Request request,
                              ModelBody modelBody)
                       throws IOException

      Executes the operation.
      Parameters:
        `name` - The name of the definition to create. If not specified, an anonymous definition will be created.
        `template` - The template of this definition.
        `role` - A comma-separated list of roles. If present, the definition will be rendered only if the current user belongs to one of the roles.
        `extendsParam` - The definition name that this definition extends.
        `preparer` - The preparer to use to invoke before the definition is rendered.
        `request` - The request.
        `modelBody` - The body.
      Throws:
        `IOException` - If something goes wrong.
      Since:
        2.2.0

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