Package org.apache.tiles.request.servlet
Class ServletApplicationContext
java.lang.Object
org.apache.tiles.request.servlet.ServletApplicationContext
- All Implemented Interfaces:
ApplicationContext
- Direct Known Subclasses:
StrutsWildcardServletApplicationContext
Servlet-based implementation of the TilesApplicationContext interface.
-
Constructor Summary
ConstructorsConstructorDescriptionServletApplicationContext
(jakarta.servlet.ServletContext servletContext) Creates a new instance of ServletTilesApplicationContext. -
Method Summary
Modifier and TypeMethodDescriptionReturns a mutable Map that maps application scope attribute names to their values.Returns the original, technology-dependent, context.Return an immutable Map that maps context application initialization parameters to their values.getResource
(String localePath) Return the application resource mapped to the specified path.getResource
(ApplicationResource base, Locale locale) Return a localized version of an ApplicationResource.getResources
(String path) Return the application resources mapped to the specified path.
-
Constructor Details
-
ServletApplicationContext
public ServletApplicationContext(jakarta.servlet.ServletContext servletContext) Creates a new instance of ServletTilesApplicationContext.- Parameters:
servletContext
- The servlet context to use.
-
-
Method Details
-
getContext
Returns the original, technology-dependent, context.- Specified by:
getContext
in interfaceApplicationContext
- Returns:
- The original application context.
-
getApplicationScope
Returns a mutable Map that maps application scope attribute names to their values.- Specified by:
getApplicationScope
in interfaceApplicationContext
- Returns:
- Map of key value pairs.
-
getInitParams
Return an immutable Map that maps context application initialization parameters to their values.- Specified by:
getInitParams
in interfaceApplicationContext
- Returns:
- initialization parameters
-
getResource
Return the application resource mapped to the specified path.- Specified by:
getResource
in interfaceApplicationContext
- 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
Return a localized version of an ApplicationResource.- Specified by:
getResource
in interfaceApplicationContext
- 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
Return the application resources mapped to the specified path.- Specified by:
getResources
in interfaceApplicationContext
- Parameters:
path
- to the desired resource.- Returns:
- all resources which match the given path.
-