Package org.apache.tiles.servlet.context
Class ServletTilesRequestContext
- java.lang.Object
-
- org.apache.tiles.context.TilesApplicationContextWrapper
-
- org.apache.tiles.servlet.context.ServletTilesRequestContext
-
- All Implemented Interfaces:
org.apache.tiles.context.TilesRequestContext,org.apache.tiles.TilesApplicationContext
public class ServletTilesRequestContext extends org.apache.tiles.context.TilesApplicationContextWrapper implements org.apache.tiles.context.TilesRequestContextServlet-based implementation of the TilesApplicationContext interface.- Version:
- $Rev$ $Date$
-
-
Constructor Summary
Constructors Constructor Description ServletTilesRequestContext(javax.servlet.ServletContext servletContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)ServletTilesRequestContext(org.apache.tiles.TilesApplicationContext applicationContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Creates a new instance of ServletTilesRequestContext.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddispatch(String path)protected voidforward(String path)Forwards to a path.org.apache.tiles.TilesApplicationContextgetApplicationContext()Map<String,String>getHeader()Map<String,String[]>getHeaderValues()OutputStreamgetOutputStream()Map<String,String>getParam()Map<String,String[]>getParamValues()PrintWritergetPrintWriter()javax.servlet.http.HttpServletRequestgetRequest()LocalegetRequestLocale()Object[]getRequestObjects()Map<String,Object>getRequestScope()javax.servlet.http.HttpServletResponsegetResponse()Map<String,Object>getSessionScope()WritergetWriter()voidinclude(String path)voidinitialize(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Initialize (or reinitialize) thisServletTilesRequestContextinstance for the specified Servlet API objects.booleanisResponseCommitted()booleanisUserInRole(String role)voidrelease()Release references to allocated resources acquired ininitialize()of via subsequent processing.voidsetContentType(String contentType)protected IOExceptionwrapServletException(javax.servlet.ServletException ex, String message)Deprecated.
-
-
-
Constructor Detail
-
ServletTilesRequestContext
public ServletTilesRequestContext(org.apache.tiles.TilesApplicationContext applicationContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Creates a new instance of ServletTilesRequestContext.- Parameters:
applicationContext- The application context.request- The request object.response- The response object.- Since:
- 2.1.1
-
ServletTilesRequestContext
@Deprecated public ServletTilesRequestContext(javax.servlet.ServletContext servletContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Deprecated.Creates a new instance of ServletTilesRequestContext.- Parameters:
servletContext- The servlet context.request- The request object.response- The response object.
-
-
Method Detail
-
getHeader
public Map<String,String> getHeader()
- Specified by:
getHeaderin interfaceorg.apache.tiles.context.TilesRequestContext
-
getHeaderValues
public Map<String,String[]> getHeaderValues()
- Specified by:
getHeaderValuesin interfaceorg.apache.tiles.context.TilesRequestContext
-
getParam
public Map<String,String> getParam()
- Specified by:
getParamin interfaceorg.apache.tiles.context.TilesRequestContext
-
getParamValues
public Map<String,String[]> getParamValues()
- Specified by:
getParamValuesin interfaceorg.apache.tiles.context.TilesRequestContext
-
getRequestScope
public Map<String,Object> getRequestScope()
- Specified by:
getRequestScopein interfaceorg.apache.tiles.context.TilesRequestContext
-
getSessionScope
public Map<String,Object> getSessionScope()
- Specified by:
getSessionScopein interfaceorg.apache.tiles.context.TilesRequestContext
-
getApplicationContext
public org.apache.tiles.TilesApplicationContext getApplicationContext()
- Specified by:
getApplicationContextin interfaceorg.apache.tiles.context.TilesRequestContext
-
dispatch
public void dispatch(String path) throws IOException
- Specified by:
dispatchin interfaceorg.apache.tiles.context.TilesRequestContext- Throws:
IOException
-
forward
protected void forward(String path) throws IOException
Forwards to a path.- Parameters:
path- The path to forward to.- Throws:
IOException- If something goes wrong during the operation.
-
include
public void include(String path) throws IOException
- Specified by:
includein interfaceorg.apache.tiles.context.TilesRequestContext- Throws:
IOException
-
getOutputStream
public OutputStream getOutputStream() throws IOException
- Specified by:
getOutputStreamin interfaceorg.apache.tiles.context.TilesRequestContext- Throws:
IOException
-
getWriter
public Writer getWriter() throws IOException
- Specified by:
getWriterin interfaceorg.apache.tiles.context.TilesRequestContext- Throws:
IOException
-
getPrintWriter
public PrintWriter getPrintWriter() throws IOException
- Specified by:
getPrintWriterin interfaceorg.apache.tiles.context.TilesRequestContext- Throws:
IOException
-
isResponseCommitted
public boolean isResponseCommitted()
- Specified by:
isResponseCommittedin interfaceorg.apache.tiles.context.TilesRequestContext
-
setContentType
public void setContentType(String contentType)
- Specified by:
setContentTypein interfaceorg.apache.tiles.context.TilesRequestContext
-
getRequestLocale
public Locale getRequestLocale()
- Specified by:
getRequestLocalein interfaceorg.apache.tiles.context.TilesRequestContext
-
getRequestObjects
public Object[] getRequestObjects()
- Specified by:
getRequestObjectsin interfaceorg.apache.tiles.context.TilesRequestContext
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
- Specified by:
getRequestin interfaceorg.apache.tiles.context.TilesRequestContext
-
getResponse
public javax.servlet.http.HttpServletResponse getResponse()
- Specified by:
getResponsein interfaceorg.apache.tiles.context.TilesRequestContext
-
initialize
public void initialize(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Initialize (or reinitialize) this
ServletTilesRequestContextinstance for the specified Servlet API objects.- Parameters:
request- TheHttpServletRequestfor this requestresponse- TheHttpServletResponsefor this request
-
release
public void release()
Release references to allocated resources acquired in
initialize()of via subsequent processing. After this method is called, subsequent calls to any other method thaninitialize()will return undefined results.
-
isUserInRole
public boolean isUserInRole(String role)
- Specified by:
isUserInRolein interfaceorg.apache.tiles.context.TilesRequestContext
-
wrapServletException
@Deprecated protected IOException wrapServletException(javax.servlet.ServletException ex, String message)
Deprecated.Wraps 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.
- Since:
- 2.0.6
-
-