org.apache.tiles.api.access

## Class TilesAccess

- java.lang.Object
- - org.apache.tiles.api.access.TilesAccess

-     public final class TilesAccess
      extends Object

  Provides static access to the Tiles container.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CONTAINER_ATTRIBUTE` The name of the attribute to use when getting and setting the container object in a context.
    `static String` | `CURRENT_CONTAINER_ATTRIBUTE_NAME` Name of the attribute used to store the current used container.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TilesContainer` | `getContainer(ApplicationContext context)` Returns default the container to be used in the application.
    `static TilesContainer` | `getContainer(ApplicationContext context, String key)` Returns the container to be used in the application registered under a specific key.
    `static TilesContainer` | `getCurrentContainer(Request request)` Returns the current container that has been set, or the default one.
    `static void` | `setContainer(ApplicationContext context, TilesContainer container, String key)` Configures the container to be used in the application.
    `static void` | `setCurrentContainer(Request request, String key)` Sets the current container to use in web pages.
    `static void` | `setCurrentContainer(Request request, TilesContainer container)` Sets the current container to use in web pages.

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

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

- - ### Field Detail

    - #### CURRENT_CONTAINER_ATTRIBUTE_NAME

          public static final String CURRENT_CONTAINER_ATTRIBUTE_NAME

      Name of the attribute used to store the current used container.
      See Also:
        Constant Field Values

    - #### CONTAINER_ATTRIBUTE

          public static final String CONTAINER_ATTRIBUTE

      The name of the attribute to use when getting and setting the container object in a context.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### setContainer

          public static void setContainer(ApplicationContext context,
                                          TilesContainer container,
                                          String key)

      Configures the container to be used in the application.
      Parameters:
        `context` - The Tiles application context object to use.
        `container` - The container object to set.
        `key` - The key under which the container will be stored.
      Since:
        2.1.2

    - #### getContainer

          public static TilesContainer getContainer(ApplicationContext context)

      Returns default the container to be used in the application.
      Parameters:
        `context` - The Tiles application context object to use.
      Returns:
        The default container object.
      Since:
        3.0.0

    - #### getContainer

          public static TilesContainer getContainer(ApplicationContext context,
                                                    String key)

      Returns the container to be used in the application registered under a specific key.
      Parameters:
        `context` - The Tiles application context object to use.
        `key` - The key under which the container will be stored.
      Returns:
        The container object.
      Since:
        3.0.0

    - #### setCurrentContainer

          public static void setCurrentContainer(Request request,
                                                 String key)

      Sets the current container to use in web pages.
      Parameters:
        `request` - The request to use.
        `key` - The key under which the container is stored.
      Since:
        2.1.0

    - #### setCurrentContainer

          public static void setCurrentContainer(Request request,
                                                 TilesContainer container)

      Sets the current container to use in web pages.
      Parameters:
        `request` - The request to use.
        `container` - The container to use as the current container.
      Since:
        2.1.0

    - #### getCurrentContainer

          public static TilesContainer getCurrentContainer(Request request)

      Returns the current container that has been set, or the default one.
      Parameters:
        `request` - The request to use.
      Returns:
        The current Tiles container to use in web pages.
      Since:
        2.1.0

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