This project has retired. For details please refer to its Attic page.
ServletUtil (Tiles 2 2.1.4 API)

org.apache.tiles.servlet.context
Class ServletUtil

Package class diagram package ServletUtil
java.lang.Object
  extended by org.apache.tiles.servlet.context.ServletUtil

public final class ServletUtil
extends Object

Utilities for Tiles servlet support.

Since:
2.0.6
Version:
$Rev: 734996 $ $Date: 2009-01-16 14:27:28 +0100 (ven, 16 gen 2009) $

Field Summary
static String CURRENT_CONTAINER_ATTRIBUTE_NAME
          Name of the attribute used to store the current used container.
static String FORCE_INCLUDE_ATTRIBUTE_NAME
          Name of the attribute used to store the force-include option.
 
Method Summary
static TilesContainer getContainer(ServletContext context)
          Returns the default Tiles container.
static TilesContainer getContainer(ServletContext context, String key)
          Returns a specific Tiles container.
static TilesContainer getCurrentContainer(ServletRequest request, ServletContext context)
          Returns the current container that has been set, or the default one.
static boolean isForceInclude(HttpServletRequest request)
          Returns true if forced include of the result is needed.
static void setContainer(ServletContext context, TilesContainer container)
          Configures the default container to be used in the application.
static void setContainer(ServletContext context, TilesContainer container, String key)
          Configures the container to be used in the application.
static void setCurrentContainer(ServletRequest request, ServletContext context, String key)
          Sets the current container to use in web pages.
static void setCurrentContainer(ServletRequest request, ServletContext context, TilesContainer container)
          Sets the current container to use in web pages.
static void setForceInclude(HttpServletRequest request, boolean forceInclude)
          Sets the option that enables the forced include of the response.
static IOException wrapServletException(ServletException ex, 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

FORCE_INCLUDE_ATTRIBUTE_NAME

public static final 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 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(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(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(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(ServletContext context,
                                          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(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(ServletContext context,
                                TilesContainer container,
                                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(ServletRequest request,
                                       ServletContext context,
                                       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(ServletRequest request,
                                       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(ServletRequest request,
                                                 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 IOException wrapServletException(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.1.1


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