Class 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.TilesRequestContext
    Servlet-based implementation of the TilesApplicationContext interface.
    Version:
    $Rev$ $Date$
    • 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
    • Method Detail

      • getHeader

        public Map<String,​String> getHeader()
        Specified by:
        getHeader in interface org.apache.tiles.context.TilesRequestContext
      • getHeaderValues

        public Map<String,​String[]> getHeaderValues()
        Specified by:
        getHeaderValues in interface org.apache.tiles.context.TilesRequestContext
      • getParam

        public Map<String,​String> getParam()
        Specified by:
        getParam in interface org.apache.tiles.context.TilesRequestContext
      • getParamValues

        public Map<String,​String[]> getParamValues()
        Specified by:
        getParamValues in interface org.apache.tiles.context.TilesRequestContext
      • getRequestScope

        public Map<String,​Object> getRequestScope()
        Specified by:
        getRequestScope in interface org.apache.tiles.context.TilesRequestContext
      • getSessionScope

        public Map<String,​Object> getSessionScope()
        Specified by:
        getSessionScope in interface org.apache.tiles.context.TilesRequestContext
      • getApplicationContext

        public org.apache.tiles.TilesApplicationContext getApplicationContext()
        Specified by:
        getApplicationContext in interface org.apache.tiles.context.TilesRequestContext
      • dispatch

        public void dispatch​(String path)
                      throws IOException
        Specified by:
        dispatch in interface org.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:
        include in interface org.apache.tiles.context.TilesRequestContext
        Throws:
        IOException
      • getOutputStream

        public OutputStream getOutputStream()
                                     throws IOException
        Specified by:
        getOutputStream in interface org.apache.tiles.context.TilesRequestContext
        Throws:
        IOException
      • getWriter

        public Writer getWriter()
                         throws IOException
        Specified by:
        getWriter in interface org.apache.tiles.context.TilesRequestContext
        Throws:
        IOException
      • getPrintWriter

        public PrintWriter getPrintWriter()
                                   throws IOException
        Specified by:
        getPrintWriter in interface org.apache.tiles.context.TilesRequestContext
        Throws:
        IOException
      • isResponseCommitted

        public boolean isResponseCommitted()
        Specified by:
        isResponseCommitted in interface org.apache.tiles.context.TilesRequestContext
      • setContentType

        public void setContentType​(String contentType)
        Specified by:
        setContentType in interface org.apache.tiles.context.TilesRequestContext
      • getRequestLocale

        public Locale getRequestLocale()
        Specified by:
        getRequestLocale in interface org.apache.tiles.context.TilesRequestContext
      • getRequestObjects

        public Object[] getRequestObjects()
        Specified by:
        getRequestObjects in interface org.apache.tiles.context.TilesRequestContext
      • getRequest

        public javax.servlet.http.HttpServletRequest getRequest()
        Specified by:
        getRequest in interface org.apache.tiles.context.TilesRequestContext
      • getResponse

        public javax.servlet.http.HttpServletResponse getResponse()
        Specified by:
        getResponse in interface org.apache.tiles.context.TilesRequestContext
      • initialize

        public void initialize​(javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response)

        Initialize (or reinitialize) this ServletTilesRequestContext instance for the specified Servlet API objects.

        Parameters:
        request - The HttpServletRequest for this request
        response - The HttpServletResponse for 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 than initialize() will return undefined results.

      • isUserInRole

        public boolean isUserInRole​(String role)
        Specified by:
        isUserInRole in interface org.apache.tiles.context.TilesRequestContext
      • wrapServletException

        @Deprecated
        protected IOException wrapServletException​(javax.servlet.ServletException ex,
                                                   String message)
        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