org.apache.struts.taglib.tiles.util
クラス TagUtils

java.lang.Object
  拡張org.apache.struts.taglib.tiles.util.TagUtils

public class TagUtils
extends java.lang.Object

Collection of utilities. This class also serves as an interface between Components and Struts. If you want to rip away Struts, simply reimplement some methods in this class. You can copy them from Struts.


フィールドの概要
static boolean debug
          Debug flag
 
コンストラクタの概要
TagUtils()
           
 
メソッドの概要
static java.lang.Object findAttribute(java.lang.String beanName, javax.servlet.jsp.PageContext pageContext)
          Search attribute in different contexts.
static java.lang.Object getAttribute(java.lang.String beanName, int scope, javax.servlet.jsp.PageContext pageContext)
          Get object from requested context.
static ComponentDefinition getComponentDefinition(java.lang.String name, javax.servlet.jsp.PageContext pageContext)
          Get component definition by its name.
static java.lang.Object getProperty(java.lang.Object bean, java.lang.String name)
          推奨されていません。 Use PropertyUtils.getProperty() directly. This will be removed after Struts 1.2.
static java.lang.Object getRealValueFromBean(java.lang.String beanName, java.lang.String beanProperty, java.lang.String beanScope, javax.servlet.jsp.PageContext pageContext)
          Locate and return the specified property of the specified bean, from an optionally specified scope, in the specified page context.
static int getScope(java.lang.String scopeName, int defaultValue)
          Get scope value from string value
static java.lang.Object retrieveBean(java.lang.String beanName, java.lang.String scopeName, javax.servlet.jsp.PageContext pageContext)
          Retrieve bean from page context, using specified scope.
static void saveException(javax.servlet.jsp.PageContext pageContext, java.lang.Throwable exception)
          Save the specified exception as a request attribute for later use.
static void setAttribute(javax.servlet.jsp.PageContext pageContext, java.lang.String name, java.lang.Object beanValue)
          Store bean in REQUEST_SCOPE context.
static void setAttribute(javax.servlet.jsp.PageContext pageContext, java.lang.String name, java.lang.Object value, java.lang.String scope)
          Store bean in requested context.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

debug

public static final boolean debug
Debug flag

関連項目:
定数フィールド値
コンストラクタの詳細

TagUtils

public TagUtils()
メソッドの詳細

getScope

public static int getScope(java.lang.String scopeName,
                           int defaultValue)
                    throws javax.servlet.jsp.JspException
Get scope value from string value

パラメータ:
scopeName - Scope as a String.
defaultValue - Returned default value, if not found.
戻り値:
Scope as an int, or defaultValue if scope is null.
例外:
javax.servlet.jsp.JspException - Scope name is not recognized as a valid scope.

getProperty

public static java.lang.Object getProperty(java.lang.Object bean,
                                           java.lang.String name)
                                    throws java.lang.IllegalAccessException,
                                           java.lang.reflect.InvocationTargetException,
                                           java.lang.NoSuchMethodException
推奨されていません。 Use PropertyUtils.getProperty() directly. This will be removed after Struts 1.2.

Return the value of the specified property of the specified bean, no matter which property reference format is used, with no type conversions.

パラメータ:
bean - Bean whose property is to be extracted.
name - Possibly indexed and/or nested name of the property to be extracted.
例外:
java.lang.IllegalAccessException - if the caller does not have access to the property accessor method
java.lang.reflect.InvocationTargetException - if the property accessor method throws an exception
java.lang.NoSuchMethodException - if an accessor method for this propety cannot be found.

retrieveBean

public static java.lang.Object retrieveBean(java.lang.String beanName,
                                            java.lang.String scopeName,
                                            javax.servlet.jsp.PageContext pageContext)
                                     throws javax.servlet.jsp.JspException
Retrieve bean from page context, using specified scope. If scope is not set, use findAttribute().

パラメータ:
beanName - Name of bean to retrieve.
scopeName - Scope or null. If null, bean is searched using findAttribute().
pageContext - Current pageContext.
戻り値:
Requested bean or null if not found.
例外:
javax.servlet.jsp.JspException - Scope name is not recognized as a valid scope.

findAttribute

public static java.lang.Object findAttribute(java.lang.String beanName,
                                             javax.servlet.jsp.PageContext pageContext)
Search attribute in different contexts. First, check in component context, then use pageContext.findAttribute().

パラメータ:
beanName - Name of bean to retrieve.
pageContext - Current pageContext.
戻り値:
Requested bean or null if not found.

getAttribute

public static java.lang.Object getAttribute(java.lang.String beanName,
                                            int scope,
                                            javax.servlet.jsp.PageContext pageContext)
Get object from requested context. Return null if not found. Context can be "component" or normal JSP contexts.

パラメータ:
beanName - Name of bean to retrieve.
scope - Scope from which bean must be retrieved.
pageContext - Current pageContext.
戻り値:
Requested bean or null if not found.

getRealValueFromBean

public static java.lang.Object getRealValueFromBean(java.lang.String beanName,
                                                    java.lang.String beanProperty,
                                                    java.lang.String beanScope,
                                                    javax.servlet.jsp.PageContext pageContext)
                                             throws javax.servlet.jsp.JspException
Locate and return the specified property of the specified bean, from an optionally specified scope, in the specified page context.

パラメータ:
pageContext - Page context to be searched.
beanName - Name of the bean to be retrieved.
beanProperty - Name of the property to be retrieved, or null to retrieve the bean itself.
beanScope - Scope to be searched (page, request, session, application) or null to use findAttribute() instead.
例外:
javax.servlet.jsp.JspException - Scope name is not recognized as a valid scope
javax.servlet.jsp.JspException - if the specified bean is not found
javax.servlet.jsp.JspException - if accessing this property causes an IllegalAccessException, IllegalArgumentException, InvocationTargetException, or NoSuchMethodException

setAttribute

public static void setAttribute(javax.servlet.jsp.PageContext pageContext,
                                java.lang.String name,
                                java.lang.Object value,
                                java.lang.String scope)
                         throws javax.servlet.jsp.JspException
Store bean in requested context. If scope is null, save it in REQUEST_SCOPE context.

パラメータ:
pageContext - Current pageContext.
name - Name of the bean.
scope - Scope under which bean is saved (page, request, session, application) or null to store in request() instead.
value - Bean value to store.
例外:
javax.servlet.jsp.JspException - Scope name is not recognized as a valid scope

setAttribute

public static void setAttribute(javax.servlet.jsp.PageContext pageContext,
                                java.lang.String name,
                                java.lang.Object beanValue)
                         throws javax.servlet.jsp.JspException
Store bean in REQUEST_SCOPE context.

パラメータ:
pageContext - Current pageContext.
name - Name of the bean.
beanValue - Bean value to store.
例外:
javax.servlet.jsp.JspException - Scope name is not recognized as a valid scope

saveException

public static void saveException(javax.servlet.jsp.PageContext pageContext,
                                 java.lang.Throwable exception)
Save the specified exception as a request attribute for later use.

パラメータ:
pageContext - The PageContext for the current page.
exception - The exception to be saved.

getComponentDefinition

public static ComponentDefinition getComponentDefinition(java.lang.String name,
                                                         javax.servlet.jsp.PageContext pageContext)
                                                  throws javax.servlet.jsp.JspException
Get component definition by its name.

パラメータ:
name - Definition name.
pageContext - The PageContext for the current page.
例外:
javax.servlet.jsp.JspException - -


このドキュメントは、Ja-Jakartaにより訳されました。コメントがある場合は、report@jajakarta.orgまでお願いします。
Copyright (C) 2000-2004 - Apache Software Foundation