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.jsp.context
Class JspUtil

    java.lang.Object
      org.apache.tiles.jsp.context.JspUtil

    public final class JspUtil

extends java.lang.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 java.lang.String` | `COMPOSE_STACK_ATTRIBUTE_NAME` The name of the attribute that will contain the compose stack.

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

  Evaluates the fragment (invokes it with a null Writer) if not null.

  Parameters:
    `fragment` - The fragment to evaluate.
  Throws:
    `javax.servlet.jsp.JspException` - If the fragment invocation fails.
    `java.io.IOException` - If the fragment invocation fails.
  Since:
    2.2.0

### evaluateFragmentAsString

    public static java.lang.String evaluateFragmentAsString(javax.servlet.jsp.tagext.JspFragment fragment)
                                                     throws javax.servlet.jsp.JspException,
                                                            java.io.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:
    `javax.servlet.jsp.JspException` - If the fragment invocation fails.
    `java.io.IOException` - If the fragment invocation fails with an I/O error.
  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.