Class ServletApplicationContext
java.lang.Object
org.apache.tiles.request.jakarta.servlet.ServletApplicationContext
- All Implemented Interfaces:
ApplicationContext
Servlet-based implementation of the TilesApplicationContext interface.
Copied from Apache tiles-request-servlet 1.0.7 and adapted for Jakarta EE 9.
-
Constructor Summary
ConstructorDescriptionServletApplicationContext
(ServletContext servletContext) Creates a new instance of ServletTilesApplicationContext. -
Method Summary
Modifier and TypeMethodDescriptionReturns the context map from application scope.Returns the servlet context to use.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
Creates a new instance of ServletTilesApplicationContext.- Parameters:
servletContext
- The servlet context to use.
-
-
Method Details
-
getContext
Returns the servlet context to use.- Specified by:
getContext
in interfaceApplicationContext
- Returns:
- the servlet context to use
-
getApplicationScope
Returns the context map from application scope.- Specified by:
getApplicationScope
in interfaceApplicationContext
- Returns:
- the context map from application scope
-
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.
-