Package org.apache.tiles.request.servlet
Class ServletUtil
java.lang.Object
org.apache.tiles.request.servlet.ServletUtil
Utilities for Tiles request servlet support.
- 
Method SummaryModifier and TypeMethodDescriptionstatic ApplicationContextgetApplicationContext(jakarta.servlet.ServletContext servletContext) Returns the application context getting it from the servlet context.static jakarta.servlet.ServletContextgetServletContext(ApplicationContext applicationContext) Gets a servlet context from a TilesApplicationContext.static ServletRequestgetServletRequest(Request request) Opens a TilesRequestContext until it finds a ServletTilesRequestContext.static IOExceptionwrapServletException(jakarta.servlet.ServletException ex, String message) Wraps a ServletException to create an IOException with the root cause if present.
- 
Method Details- 
wrapServletExceptionWraps a ServletException to create an IOException with the root cause if present.- Parameters:
- ex- The exception to wrap.
- message- The message of the exception.
- Returns:
- The wrapped exception.
 
- 
getApplicationContextpublic static ApplicationContext getApplicationContext(jakarta.servlet.ServletContext servletContext) Returns the application context getting it from the servlet context. It must be first saved creating aServletApplicationContextand usingApplicationAccess.register(ApplicationContext).- Parameters:
- servletContext- The servlet context.
- Returns:
- The application context, if found, nullotherwise.
 
- 
getServletRequestOpens a TilesRequestContext until it finds a ServletTilesRequestContext.- Parameters:
- request- The request to open.
- Returns:
- The servlet-based request context.
- Throws:
- NotAServletEnvironmentException- If a servlet-based request context could not be found.
 
- 
getServletContextpublic static jakarta.servlet.ServletContext getServletContext(ApplicationContext applicationContext) Gets a servlet context from a TilesApplicationContext.- Parameters:
- applicationContext- The application context to analyze.
- Returns:
- The servlet context.
- Throws:
- NotAServletEnvironmentException- If the application context is not servlet-based.
 
 
-