org.apache.tiles.web.jsp.taglib

## Class DefinitionTag

- java.lang.Object
- - javax.servlet.jsp.tagext.SimpleTagSupport
  - - org.apache.tiles.web.jsp.taglib.DefinitionTag

- All Implemented Interfaces:
    javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag

      public class DefinitionTag
      extends javax.servlet.jsp.tagext.SimpleTagSupport

  Create a definition at runtime.

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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefinitionTag()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `doTag()`
    `String` | `getExtends()` Getter for extends property.
    `String` | `getName()` Getter for name property.
    `String` | `getPreparer()` Getter for preparer property.
    `String` | `getRole()` Getter for role property.
    `String` | `getTemplate()` Getter for template property.
    `void` | `setExtends(String extendsParam)` Setter for extends property.
    `void` | `setName(String name)` Setter for name property.
    `void` | `setPreparer(String preparer)` Setter for preparer property.
    `void` | `setRole(String role)` Setter for role property.
    `void` | `setTemplate(String template)` Setter for template property.

    - ### Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport

      `findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent`

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

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

- - ### Constructor Detail

    - #### DefinitionTag

          public DefinitionTag()

  - ### Method Detail

    - #### getName

          public String getName()

      Getter for name property.
      Returns:
        The name of the definition to create. If not specified, an anonymous definition will be created.

    - #### setName

          public void setName(String name)

      Setter for name property.
      Parameters:
        `name` - The name of the definition to create. If not specified, an anonymous definition will be created.

    - #### getTemplate

          public String getTemplate()

      Getter for template property.
      Returns:
        The template of this definition.

    - #### setTemplate

          public void setTemplate(String template)

      Setter for template property.
      Parameters:
        `template` - The template of this definition.

    - #### getRole

          public String getRole()

      Getter for role property.
      Returns:
        A comma-separated list of roles. If present, the definition will be rendered only if the current user belongs to one of the roles.

    - #### setRole

          public void setRole(String role)

      Setter for role property.
      Parameters:
        `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.

    - #### getExtends

          public String getExtends()

      Getter for extends property.
      Returns:
        The definition name that this definition extends.

    - #### setExtends

          public void setExtends(String extendsParam)

      Setter for extends property.
      Parameters:
        `extendsParam` - The definition name that this definition extends.

    - #### getPreparer

          public String getPreparer()

      Getter for preparer property.
      Returns:
        The preparer to use to invoke before the definition is rendered.

    - #### setPreparer

          public void setPreparer(String preparer)

      Setter for preparer property.
      Parameters:
        `preparer` - The preparer to use to invoke before the definition is rendered.

    - #### doTag

          public void doTag()
                     throws javax.servlet.jsp.JspException,
                            IOException

      Specified by:
        `doTag` in interface `javax.servlet.jsp.tagext.SimpleTag`
      Overrides:
        `doTag` in class `javax.servlet.jsp.tagext.SimpleTagSupport`
      Throws:
        `javax.servlet.jsp.JspException`
        `IOException`

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