org.apache.tiles.request.jsp

## Class JspRequest

- java.lang.Object
- - org.apache.tiles.request.AbstractRequest
  - - org.apache.tiles.request.DispatchRequestWrapper
    - - org.apache.tiles.request.AbstractViewRequest
      - - org.apache.tiles.request.jsp.JspRequest

- All Implemented Interfaces:
    DispatchRequest, Request, RequestWrapper

      public class JspRequest
      extends AbstractViewRequest

  Context implementation used for executing tiles within a jsp tag library.

- - ### Field Summary

    - ### Fields inherited from class org.apache.tiles.request.AbstractRequest

      `FORCE_INCLUDE_ATTRIBUTE_NAME`

    - ### Fields inherited from interface org.apache.tiles.request.Request

      `APPLICATION_SCOPE, REQUEST_SCOPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JspRequest(DispatchRequest enclosedRequest, javax.servlet.jsp.PageContext pageContext)` Constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JspRequest` | `createServletJspRequest(ApplicationContext applicationContext, javax.servlet.jsp.PageContext pageContext)` Creates a JSP request.
    `protected void` | `doInclude(String path)` Includes the result.
    `Map<String,Object>` | `getApplicationScope()` Returns the application scope.
    `List<String>` | `getAvailableScopes()` Returns all available scopes.
    `Map<String,Object>` | `getContext(String scope)` Returns a context map, given the scope name.
    `Map<String,Object>` | `getPageScope()` Returns the page scope.
    `PrintWriter` | `getPrintWriter()` Returns a print writer to be used to write directly in the response.
    `Map<String,Object>` | `getRequestScope()` Returns the request scope.
    `Map<String,Object>` | `getSessionScope()` Returns the session scope.
    `Writer` | `getWriter()` Returns a writer to be used to write directly in the response.

    - ### Methods inherited from class org.apache.tiles.request.AbstractViewRequest

      `dispatch, include`

    - ### Methods inherited from class org.apache.tiles.request.DispatchRequestWrapper

      `getApplicationContext, getHeader, getHeaderValues, getOutputStream, getParam, getParamValues, getRequestLocale, getResponseHeaders, getWrappedRequest, isResponseCommitted, isUserInRole, setContentType`

    - ### Methods inherited from class org.apache.tiles.request.AbstractRequest

      `isForceInclude, setForceInclude`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JspRequest

          public JspRequest(DispatchRequest enclosedRequest,
                            javax.servlet.jsp.PageContext pageContext)

      Constructor.
      Parameters:
        `enclosedRequest` - The request that is wrapped here.
        `pageContext` - The page context to use.

  - ### Method Detail

    - #### createServletJspRequest

          public static JspRequest createServletJspRequest(ApplicationContext applicationContext,
                                                           javax.servlet.jsp.PageContext pageContext)

      Creates a JSP request.
      Parameters:
        `applicationContext` - The application context.
        `pageContext` - The page context.
      Returns:
        A new JSP request.

    - #### getAvailableScopes

          public List<String> getAvailableScopes()

      Description copied from class: `DispatchRequestWrapper`
      Returns all available scopes. The scopes are ordered according to their lifetime, the innermost, shorter lived scope appears first, and the outermost, longer lived scope appears last. Besides, the scopes "request" and "application" always included in the list.
      Specified by:
        `getAvailableScopes` in interface `Request`
      Overrides:
        `getAvailableScopes` in class `DispatchRequestWrapper`
      Returns:
        All the available scopes.

    - #### doInclude

          protected void doInclude(String path)
                            throws IOException

      Includes the result. By default, uses the wrapped request for the inclusion.
      Overrides:
        `doInclude` in class `AbstractViewRequest`
      Parameters:
        `path` - The path whose result will be included.
      Throws:
        `IOException` - If something goes wrong.

    - #### getPrintWriter

          public PrintWriter getPrintWriter()

      Returns a print writer to be used to write directly in the response.
      Specified by:
        `getPrintWriter` in interface `Request`
      Overrides:
        `getPrintWriter` in class `DispatchRequestWrapper`
      Returns:
        The print writer that writes in the response.

    - #### getWriter

          public Writer getWriter()

      Returns a writer to be used to write directly in the response.
      Specified by:
        `getWriter` in interface `Request`
      Overrides:
        `getWriter` in class `DispatchRequestWrapper`
      Returns:
        The writer that writes in the response.

    - #### getPageScope

          public Map<String,Object> getPageScope()

      Returns the page scope.
      Returns:
        The page scope.

    - #### getRequestScope

          public Map<String,Object> getRequestScope()

      Returns the request scope.
      Returns:
        The request scope.

    - #### getSessionScope

          public Map<String,Object> getSessionScope()

      Returns the session scope.
      Returns:
        The session scope.

    - #### getApplicationScope

          public Map<String,Object> getApplicationScope()

      Returns the application scope.
      Returns:
        The application scope.

    - #### getContext

          public Map<String,Object> getContext(String scope)

      Description copied from class: `DispatchRequestWrapper`
      Returns a context map, given the scope name. This method always return a map for all the scope names returned by getAvailableScopes(). That map may be writable, or immutable, depending on the implementation.
      Specified by:
        `getContext` in interface `Request`
      Overrides:
        `getContext` in class `DispatchRequestWrapper`
      Parameters:
        `scope` - The name of the scope.
      Returns:
        The context.

Copyright © 2000–2025 Apache Software Foundation. All rights reserved.