Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tiles.servlet.context
Class ServletUtil

    java.lang.Object
      org.apache.tiles.servlet.context.ServletUtil

    public final class ServletUtil

extends java.lang.Object

Utilities for Tiles servlet support.

Since:
  2.0.6
Version:
  $Rev: 797765 $ $Date: 2009-07-25 15:20:26 +0200 (sab, 25 lug 2009) $

Field Summary
`static java.lang.String` | `COMPOSE_STACK_ATTRIBUTE_NAME` The name of the attribute that will contain the compose stack.
`static java.lang.String` | `CURRENT_CONTAINER_ATTRIBUTE_NAME` Name of the attribute used to store the current used container.
`static java.lang.String` | `FORCE_INCLUDE_ATTRIBUTE_NAME` Name of the attribute used to store the force-include option.

Method Summary
`static ArrayStack<java.lang.Object>` | `getComposeStack(javax.servlet.http.HttpServletRequest request)` Returns the compose stack, that is used by the tags to compose definitions, attributes, etc.
`static TilesContainer` | `getContainer(javax.servlet.ServletContext context)` Returns the default Tiles container.
`static TilesContainer` | `getContainer(javax.servlet.ServletContext context, java.lang.String key)` Returns a specific Tiles container.
`static TilesContainer` | `getCurrentContainer(javax.servlet.ServletRequest request, javax.servlet.ServletContext context)` Returns the current container that has been set, or the default one.
`static javax.servlet.ServletContext` | `getServletContext(TilesApplicationContext applicationContext)` Gets a servlet context from a TilesApplicationContext.
`static ServletTilesRequestContext` | `getServletRequest(TilesRequestContext request)` Opens a TilesRequestContext until it finds a ServletTilesRequestContext.
`static boolean` | `isForceInclude(javax.servlet.http.HttpServletRequest request)` Returns true if forced include of the result is needed.
`static void` | `setContainer(javax.servlet.ServletContext context, TilesContainer container)` Configures the default container to be used in the application.
`static void` | `setContainer(javax.servlet.ServletContext context, TilesContainer container, java.lang.String key)` Configures the container to be used in the application.
`static void` | `setCurrentContainer(javax.servlet.ServletRequest request, javax.servlet.ServletContext context, java.lang.String key)` Sets the current container to use in web pages.
`static void` | `setCurrentContainer(javax.servlet.ServletRequest request, javax.servlet.ServletContext context, TilesContainer container)` Sets the current container to use in web pages.
`static void` | `setForceInclude(javax.servlet.http.HttpServletRequest request, boolean forceInclude)` Sets the option that enables the forced include of the response.
`static java.io.IOException` | `wrapServletException(javax.servlet.ServletException ex, java.lang.String message)` Wraps a ServletException to create an IOException with the root cause if present.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### COMPOSE_STACK_ATTRIBUTE_NAME

    public static final java.lang.String COMPOSE_STACK_ATTRIBUTE_NAME

  The name of the attribute that will contain the compose stack.

  See Also:
    Constant Field Values

### FORCE_INCLUDE_ATTRIBUTE_NAME

    public static final java.lang.String FORCE_INCLUDE_ATTRIBUTE_NAME

  Name of the attribute used to store the force-include option.

  Since:
    2.0.6
  See Also:
    Constant Field Values

### CURRENT_CONTAINER_ATTRIBUTE_NAME

    public static final java.lang.String CURRENT_CONTAINER_ATTRIBUTE_NAME

  Name of the attribute used to store the current used container.

  See Also:
    Constant Field Values

Method Detail

### isForceInclude

    public static boolean isForceInclude(javax.servlet.http.HttpServletRequest request)

  Returns true if forced include of the result is needed.

  Parameters:
    `request` - The HTTP request.
  Returns:
    If `true` the include operation must be forced.
  Since:
    2.0.6

### setForceInclude

    public static void setForceInclude(javax.servlet.http.HttpServletRequest request,
                                       boolean forceInclude)

  Sets the option that enables the forced include of the response.

  Parameters:
    `request` - The HTTP request.
    `forceInclude` - If `true` the include operation must be forced.
  Since:
    2.0.6

### getContainer

    public static TilesContainer getContainer(javax.servlet.ServletContext context)

  Returns the default Tiles container.

  Parameters:
    `context` - The servlet context to use.
  Returns:
    The default Tiles container.
  Since:
    2.1.2

### getContainer

    public static TilesContainer getContainer(javax.servlet.ServletContext context,
                                              java.lang.String key)

  Returns a specific Tiles container.

  Parameters:
    `context` - The servlet context to use.
    `key` - The key under which the container is stored. If null, the default container will be returned.
  Returns:
    The requested Tiles container.
  Since:
    2.1.2

### setContainer

    public static void setContainer(javax.servlet.ServletContext context,
                                    TilesContainer container)

  Configures the default container to be used in the application.

  Parameters:
    `context` - The servlet context object to use.
    `container` - The container object to set.
  Since:
    2.1.2

### setContainer

    public static void setContainer(javax.servlet.ServletContext context,
                                    TilesContainer container,
                                    java.lang.String key)

  Configures the container to be used in the application.

  Parameters:
    `context` - The servlet context object to use.
    `container` - The container object to set.
    `key` - The key under which the container will be stored.
  Since:
    2.1.2

### setCurrentContainer

    public static void setCurrentContainer(javax.servlet.ServletRequest request,
                                           javax.servlet.ServletContext context,
                                           java.lang.String key)

  Sets the current container to use in web pages.

  Parameters:
    `request` - The request to use.
    `context` - The servlet context to use.
    `key` - The key under which the container is stored.
  Since:
    2.1.0

### setCurrentContainer

    public static void setCurrentContainer(javax.servlet.ServletRequest request,
                                           javax.servlet.ServletContext context,
                                           TilesContainer container)

  Sets the current container to use in web pages.

  Parameters:
    `request` - The request to use.
    `context` - The servlet context to use.
    `container` - The container to use as the current container.
  Since:
    2.1.0

### getCurrentContainer

    public static TilesContainer getCurrentContainer(javax.servlet.ServletRequest request,
                                                     javax.servlet.ServletContext context)

  Returns the current container that has been set, or the default one.

  Parameters:
    `request` - The request to use.
    `context` - The servlet context to use.
  Returns:
    The current Tiles container to use in web pages.
  Since:
    2.1.0

### wrapServletException

    public static java.io.IOException wrapServletException(javax.servlet.ServletException ex,
                                                           java.lang.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.1.1

### getComposeStack

    public static ArrayStack<java.lang.Object> getComposeStack(javax.servlet.http.HttpServletRequest request)

  Returns the compose stack, that is used by the tags to compose definitions, attributes, etc.

  Parameters:
    `request` - The HTTP request.
  Returns:
    The compose stack.
  Since:
    2.2.0

### getServletRequest

    public static ServletTilesRequestContext getServletRequest(TilesRequestContext request)

  Opens 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.
  Since:
    2.2.0

### getServletContext

    public static javax.servlet.ServletContext getServletContext(TilesApplicationContext 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.
  Since:
    2.2.0

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2010 Apache Software Foundation. All Rights Reserved.