org.apache.tiles.request.servlet

## Class ServletApplicationContext

- java.lang.Object
- - org.apache.tiles.request.servlet.ServletApplicationContext

- All Implemented Interfaces:
    ApplicationContext
  Direct Known Subclasses:
    StrutsWildcardServletApplicationContext

      public class ServletApplicationContext
      extends Object
      implements ApplicationContext

  Servlet-based implementation of the TilesApplicationContext interface.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServletApplicationContext(javax.servlet.ServletContext servletContext)` Creates a new instance of ServletTilesApplicationContext.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Map<String,Object>` | `getApplicationScope()` Returns a mutable Map that maps application scope attribute names to their values.
    `Object` | `getContext()` Returns the original, technology-dependent, context.
    `Map<String,String>` | `getInitParams()` Return an immutable Map that maps context application initialization parameters to their values.
    `ApplicationResource` | `getResource(ApplicationResource base, Locale locale)` Return a localized version of an ApplicationResource.
    `ApplicationResource` | `getResource(String localePath)` Return the application resource mapped to the specified path.
    `Collection<ApplicationResource>` | `getResources(String path)` Return the application resources mapped to the specified path.

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

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

- - ### Constructor Detail

    - #### ServletApplicationContext

          public ServletApplicationContext(javax.servlet.ServletContext servletContext)

      Creates a new instance of ServletTilesApplicationContext.
      Parameters:
        `servletContext` - The servlet context to use.

  - ### Method Detail

    - #### getContext

          public Object getContext()

      Returns the original, technology-dependent, context.
      Specified by:
        `getContext` in interface `ApplicationContext`
      Returns:
        The original application context.

    - #### getApplicationScope

          public Map<String,Object> getApplicationScope()

      Returns a mutable Map that maps application scope attribute names to their values.
      Specified by:
        `getApplicationScope` in interface `ApplicationContext`
      Returns:
        Map of key value pairs.

    - #### getInitParams

          public Map<String,String> getInitParams()

      Return an immutable Map that maps context application initialization parameters to their values.
      Specified by:
        `getInitParams` in interface `ApplicationContext`
      Returns:
        initialization parameters

    - #### getResource

          public ApplicationResource getResource(String localePath)

      Return the application resource mapped to the specified path.
      Specified by:
        `getResource` in interface `ApplicationContext`
      Parameters:
        `localePath` - path to the desired resource, including the Locale suffix.
      Returns:
        the first located resource which matches the given path or null if no such resource exists.

    - #### getResource

          public ApplicationResource getResource(ApplicationResource base,
                                                 Locale locale)

      Return a localized version of an ApplicationResource.
      Specified by:
        `getResource` in interface `ApplicationContext`
      Parameters:
        `base` - the ApplicationResource.
        `locale` - the desired Locale.
      Returns:
        the first located resource which matches the given path or null if no such resource exists.

    - #### getResources

          public Collection<ApplicationResource> getResources(String path)

      Return the application resources mapped to the specified path.
      Specified by:
        `getResources` in interface `ApplicationContext`
      Parameters:
        `path` - to the desired resource.
      Returns:
        all resources which match the given path.

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