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

org.apache.tiles.jsp.context
Class JspUtil

Package class diagram package JspUtil
java.lang.Object
  extended by org.apache.tiles.jsp.context.JspUtil

public final class JspUtil
extends Object

Utility class for working within a Jsp environment.

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

Field Summary
static String COMPOSE_STACK_ATTRIBUTE_NAME
          The name of the attribute that will contain the compose stack.
 
Method Summary
static void evaluateFragment(JspFragment fragment)
          Evaluates the fragment (invokes it with a null Writer) if not null.
static String evaluateFragmentAsString(JspFragment fragment)
          Evaluates the fragment and returns its content as a string.
static ArrayStack<Object> getComposeStack(JspContext context)
          Returns the compose stack, that is used by the tags to compose definitions, attributes, etc.
static TilesContainer getContainer(JspContext context)
          Returns the default Tiles container.
static TilesContainer getContainer(JspContext context, String key)
          Returns a specific Tiles container.
static TilesContainer getCurrentContainer(JspContext context)
          Returns the current container that has been set, or the default one.
static int getScope(String scopeName)
          Converts the scope name into its corresponding PageContext constant value.
static boolean isForceInclude(JspContext context)
          Returns true if forced include of the result is needed.
static void setContainer(JspContext context, TilesContainer container)
          Configures the default container to be used in the application.
static void setContainer(JspContext context, TilesContainer container, String key)
          Configures the container to be used in the application.
static void setCurrentContainer(JspContext context, String key)
          Sets the current container to use in web pages.
static void setCurrentContainer(JspContext context, TilesContainer container)
          Sets the current container to use in web pages.
static void setForceInclude(JspContext context, boolean forceInclude)
          Sets the option that enables the forced include of the response.
 
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 String COMPOSE_STACK_ATTRIBUTE_NAME
The name of the attribute that will contain the compose stack.

See Also:
Constant Field Values
Method Detail

isForceInclude

public static boolean isForceInclude(JspContext context)
Returns true if forced include of the result is needed.

Parameters:
context - The page context.
Returns:
If true the include operation must be forced.
Since:
2.0.6

setForceInclude

public static void setForceInclude(JspContext context,
                                   boolean forceInclude)
Sets the option that enables the forced include of the response.

Parameters:
context - The page context.
forceInclude - If true the include operation must be forced.
Since:
2.0.6

getContainer

public static TilesContainer getContainer(JspContext context)
Returns the default Tiles container.

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

getContainer

public static TilesContainer getContainer(JspContext context,
                                          String key)
Returns a specific Tiles container.

Parameters:
context - The page 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(JspContext context,
                                TilesContainer container)
Configures the default container to be used in the application.

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

setContainer

public static void setContainer(JspContext context,
                                TilesContainer container,
                                String key)
Configures the container to be used in the application.

Parameters:
context - The page 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(JspContext context,
                                       String key)
Sets the current container to use in web pages.

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

setCurrentContainer

public static void setCurrentContainer(JspContext context,
                                       TilesContainer container)
Sets the current container to use in web pages.

Parameters:
context - The page context to use.
container - The container to use as the current container.
Since:
2.1.0

getCurrentContainer

public static TilesContainer getCurrentContainer(JspContext context)
Returns the current container that has been set, or the default one.

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

getComposeStack

public static ArrayStack<Object> getComposeStack(JspContext context)
Returns the compose stack, that is used by the tags to compose definitions, attributes, etc.

Parameters:
context - The page context.
Returns:
The compose stack.
Since:
2.2.0

getScope

public static int getScope(String scopeName)
                    throws TilesJspException
Converts the scope name into its corresponding PageContext constant value.

Parameters:
scopeName - Can be "page", "request", "session", or "application" in any case.
Returns:
The constant representing the scope (ie. PageContext.REQUEST_SCOPE).
Throws:
TilesJspException - if the scopeName is not a valid name.
Since:
2.2.0

evaluateFragment

public static void evaluateFragment(JspFragment fragment)
                             throws JspException,
                                    IOException
Evaluates the fragment (invokes it with a null Writer) if not null.

Parameters:
fragment - The fragment to evaluate.
Throws:
JspException - If the fragment invocation fails.
IOException - If the fragment invocation fails.
Since:
2.2.0

evaluateFragmentAsString

public static String evaluateFragmentAsString(JspFragment fragment)
                                       throws JspException,
                                              IOException
Evaluates the fragment and returns its content as a string.

Parameters:
fragment - The fragment to evaluate.
Returns:
The fragment evaluated as a string.
Throws:
JspException - If the fragment invocation fails.
IOException - If the fragment invocation fails with an I/O error.
Since:
2.2.0


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