org.apache.struts.util
クラス RequestUtils

java.lang.Object
  拡張org.apache.struts.util.RequestUtils

public class RequestUtils
extends java.lang.Object

General purpose utility methods related to processing a servlet request in the Struts controller framework.

バージョン:
$Revision: 1.1 $ $Date: 2004/10/20 03:26:41 $

フィールドの概要
protected static org.apache.commons.logging.Log log
          Commons Logging instance.
 
コンストラクタの概要
RequestUtils()
           
 
メソッドの概要
static java.net.URL absoluteURL(javax.servlet.http.HttpServletRequest request, java.lang.String path)
          Create and return an absolute URL for the specified context-relative path, based on the server and context information in the specified request.
static java.lang.String actionURL(javax.servlet.http.HttpServletRequest request, ActionConfig action, java.lang.String pattern)
          Return the context-relative URL that corresponds to the specified ActionConfig, relative to the module associated with the current modules's ModuleConfig.
static java.lang.Class applicationClass(java.lang.String className)
          Return the Class object for the specified fully qualified class name, from this web application's class loader.
static java.lang.Object applicationInstance(java.lang.String className)
          Return a new instance of the specified fully qualified class name, after loading the class from this web application's class loader.
private static boolean canReuseActionForm(ActionForm instance, FormBeanConfig config)
          Determine whether instance of ActionForm is suitable for re-use as an instance of the form described by config.
static java.util.Map computeParameters(javax.servlet.jsp.PageContext pageContext, java.lang.String paramId, java.lang.String paramName, java.lang.String paramProperty, java.lang.String paramScope, java.lang.String name, java.lang.String property, java.lang.String scope, boolean transaction)
          推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.computeParameters(PageContext,String,String,String,String,String,String,String,boolean) instead.
static java.lang.String computeURL(javax.servlet.jsp.PageContext pageContext, java.lang.String forward, java.lang.String href, java.lang.String page, java.util.Map params, java.lang.String anchor, boolean redirect)
          推奨されていません。 This will be removed after Struts 1.2 Use computeURL(PageContext, String, String, String, String, Map, String, boolean) instead.
static java.lang.String computeURL(javax.servlet.jsp.PageContext pageContext, java.lang.String forward, java.lang.String href, java.lang.String page, java.lang.String action, java.util.Map params, java.lang.String anchor, boolean redirect)
          推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.computeURL(PageContext,String,String,String,String,String,Map,String, boolean) instead.
static java.lang.String computeURL(javax.servlet.jsp.PageContext pageContext, java.lang.String forward, java.lang.String href, java.lang.String page, java.lang.String action, java.util.Map params, java.lang.String anchor, boolean redirect, boolean encodeSeparator)
          推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.computeURL(PageContext,String,String,String,String,String,Map,String,boolean,boolean) instead.
static ActionForm createActionForm(FormBeanConfig config, ActionServlet servlet)
          Create and return an ActionForm instance appropriate to the information in config.
static ActionForm createActionForm(javax.servlet.http.HttpServletRequest request, ActionMapping mapping, ModuleConfig moduleConfig, ActionServlet servlet)
          Create (if necessary) and return an ActionForm instance appropriate for this request.
static java.lang.StringBuffer createServerStringBuffer(java.lang.String scheme, java.lang.String server, int port)
          Return StringBuffer representing the scheme, server, and port number of the current request.
static java.lang.StringBuffer createServerUriStringBuffer(java.lang.String scheme, java.lang.String server, int port, java.lang.String uri)
          Return StringBuffer representing the scheme, server, and port number of the current request.
static java.lang.String encodeURL(java.lang.String url)
          推奨されていません。 Use TagUtils.encodeURL(String) instead. This will be removed after Struts 1.2.
static java.lang.String forwardURL(javax.servlet.http.HttpServletRequest request, ForwardConfig forward)
          Return the context-relative URL that corresponds to the specified ForwardConfig.
static java.lang.String forwardURL(javax.servlet.http.HttpServletRequest request, ForwardConfig forward, ModuleConfig moduleConfig)
          Return the context-relative URL that corresponds to the specified ForwardConfig.
static ActionErrors getActionErrors(javax.servlet.jsp.PageContext pageContext, java.lang.String paramName)
          推奨されていません。 Use TagUtils.getActionErrors(PageContext,String) instead. This will be removed after Struts 1.2.
static java.lang.String getActionMappingName(java.lang.String action)
          推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.getActionMappingName(String) instead.
static java.lang.String getActionMappingURL(java.lang.String action, javax.servlet.jsp.PageContext pageContext)
          推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.getActionMappingURL(String,PageContext) instead.
static ActionMessages getActionMessages(javax.servlet.jsp.PageContext pageContext, java.lang.String paramName)
          推奨されていません。 Use TagUtils.getActionMessages(PageContext,String) instead. This will be removed after Struts 1.2.
private static java.util.Map getAllParametersForMultipartRequest(javax.servlet.http.HttpServletRequest request, MultipartRequestHandler multipartHandler)
          Create a Map containing all of the parameters supplied for a multipart request, keyed by parameter name.
static ModuleConfig getModuleConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext context)
          推奨されていません。 Use ModuleUtils.getModuleConfig(HttpServletRequest,ServletContext) instead. This will be removed after Struts 1.2.
static ModuleConfig getModuleConfig(javax.servlet.jsp.PageContext pageContext)
          推奨されていません。 Use TagUtils.getModuleConfig(PageContext) instead. This will be removed after Struts 1.2.
static java.lang.String getModuleName(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext context)
          推奨されていません。 Use Use ModuleUtils.getModuleName(HttpServletRequest,ServletContext) instead. This will be removed after Struts 1.2.
static java.lang.String getModuleName(java.lang.String matchPath, javax.servlet.ServletContext context)
          推奨されていません。 Use ModuleUtils.getModuleName(String,ServletContext) instead. This will be removed after Struts 1.2.
static java.lang.String[] getModulePrefixes(javax.servlet.ServletContext context)
          推奨されていません。 Use ModuleUtils.getModulePrefixes(ServletContext) instead. This will be removed after Struts 1.2.
private static MultipartRequestHandler getMultipartHandler(javax.servlet.http.HttpServletRequest request)
          Try to locate a multipart request handler for this request.
static ModuleConfig getRequestModuleConfig(javax.servlet.http.HttpServletRequest request)
          推奨されていません。 Use ModuleUtils.getModuleConfig(HttpServletRequest) instead. This will be removed after Struts 1.2.
static int getScope(java.lang.String scopeName)
          推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.getScope(String) instead.
static java.util.Locale getUserLocale(javax.servlet.http.HttpServletRequest request, java.lang.String locale)
          Look up and return current user locale, based on the specified parameters.
static boolean isXhtml(javax.servlet.jsp.PageContext pageContext)
          推奨されていません。 Use TagUtils.isXhtml(PageContext) instead. This will be removed after Struts 1.2.
static java.lang.Object lookup(javax.servlet.jsp.PageContext pageContext, java.lang.String name, java.lang.String scopeName)
          推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.lookup(PageContext,String,String) instead.
static java.lang.Object lookup(javax.servlet.jsp.PageContext pageContext, java.lang.String name, java.lang.String property, java.lang.String scope)
          推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.lookup(PageContext,String,String,String) instead.
private static ActionForm lookupActionForm(javax.servlet.http.HttpServletRequest request, java.lang.String attribute, java.lang.String scope)
           
static java.lang.String message(javax.servlet.jsp.PageContext pageContext, java.lang.String bundle, java.lang.String locale, java.lang.String key)
          推奨されていません。 Use TagUtils.message(PageContext,String,String,String) instead. This will be removed after Struts 1.2.
static java.lang.String message(javax.servlet.jsp.PageContext pageContext, java.lang.String bundle, java.lang.String locale, java.lang.String key, java.lang.Object[] args)
          推奨されていません。 Use TagUtils.message(PageContext,String,String,String,Object[]) instead. This will be removed after Struts 1.2.
static java.lang.String pageURL(javax.servlet.http.HttpServletRequest request, java.lang.String page)
          推奨されていません。 Use TagUtils.pageURL(HttpServletRequest request, String page, ModuleConfig moduleConfig) instead. This will be removed after Struts 1.2.
static void populate(java.lang.Object bean, javax.servlet.http.HttpServletRequest request)
          Populate the properties of the specified JavaBean from the specified HTTP request, based on matching each parameter name against the corresponding JavaBeans "property setter" methods in the bean's class.
static void populate(java.lang.Object bean, java.lang.String prefix, java.lang.String suffix, javax.servlet.http.HttpServletRequest request)
          Populate the properties of the specified JavaBean from the specified HTTP request, based on matching each parameter name (plus an optional prefix and/or suffix) against the corresponding JavaBeans "property setter" methods in the bean's class.
static boolean present(javax.servlet.jsp.PageContext pageContext, java.lang.String bundle, java.lang.String locale, java.lang.String key)
          推奨されていません。 Use TagUtils.present(PageContext ,String,String,String) instead. This will be removed after Struts 1.2.
static java.lang.String printableURL(java.net.URL url)
          Compute the printable representation of a URL, leaving off the scheme/host/port part if no host is specified.
static java.lang.StringBuffer requestToServerStringBuffer(javax.servlet.http.HttpServletRequest request)
          Return StringBuffer representing the scheme, server, and port number of the current request.
static java.lang.StringBuffer requestToServerUriStringBuffer(javax.servlet.http.HttpServletRequest request)
          Return the string representing the scheme, server, and port number of the current request.
static java.net.URL requestURL(javax.servlet.http.HttpServletRequest request)
          Return the URL representing the current request.
static java.util.Locale retrieveUserLocale(javax.servlet.jsp.PageContext pageContext, java.lang.String locale)
          推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.getUserLocale(PageContext,String) instead.
static void saveException(javax.servlet.jsp.PageContext pageContext, java.lang.Throwable exception)
          推奨されていません。 Use TagUtils.saveException(PageContext,Throwable) instead. This will be removed after Struts 1.2.
static void selectModule(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext context)
          推奨されていません。 Use ModuleUtils.selectModule(HttpServletRequest,ServletContext) instead. This will be removed after Struts 1.2.
static void selectModule(java.lang.String prefix, javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext context)
          推奨されていません。 Use ModuleUtils.selectModule(String,HttpServletRequest,ServletContext) instead. This will be removed after Struts 1.2.
static java.net.URL serverURL(javax.servlet.http.HttpServletRequest request)
          Return the URL representing the scheme, server, and port number of the current request.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

log

protected static org.apache.commons.logging.Log log

Commons Logging instance.

コンストラクタの詳細

RequestUtils

public RequestUtils()
メソッドの詳細

absoluteURL

public static java.net.URL absoluteURL(javax.servlet.http.HttpServletRequest request,
                                       java.lang.String path)
                                throws java.net.MalformedURLException

Create and return an absolute URL for the specified context-relative path, based on the server and context information in the specified request.

パラメータ:
request - The servlet request we are processing
path - The context-relative path (must start with '/')
戻り値:
absolute URL based on context-relative path
例外:
java.net.MalformedURLException - if we cannot create an absolute URL

applicationClass

public static java.lang.Class applicationClass(java.lang.String className)
                                        throws java.lang.ClassNotFoundException

Return the Class object for the specified fully qualified class name, from this web application's class loader.

パラメータ:
className - Fully qualified class name to be loaded
戻り値:
Class object
例外:
java.lang.ClassNotFoundException - if the class cannot be found

applicationInstance

public static java.lang.Object applicationInstance(java.lang.String className)
                                            throws java.lang.ClassNotFoundException,
                                                   java.lang.IllegalAccessException,
                                                   java.lang.InstantiationException

Return a new instance of the specified fully qualified class name, after loading the class from this web application's class loader. The specified class MUST have a public zero-arguments constructor.

パラメータ:
className - Fully qualified class name to use
戻り値:
new instance of class
例外:
java.lang.ClassNotFoundException - if the class cannot be found
java.lang.IllegalAccessException - if the class or its constructor is not accessible
java.lang.InstantiationException - if this class represents an abstract class, an interface, an array class, a primitive type, or void
java.lang.InstantiationException - if this class has no zero-arguments constructor

createActionForm

public static ActionForm createActionForm(javax.servlet.http.HttpServletRequest request,
                                          ActionMapping mapping,
                                          ModuleConfig moduleConfig,
                                          ActionServlet servlet)

Create (if necessary) and return an ActionForm instance appropriate for this request. If no ActionForm instance is required, return null.

パラメータ:
request - The servlet request we are processing
mapping - The action mapping for this request
moduleConfig - The configuration for this module
servlet - The action servlet
戻り値:
ActionForm instance associated with this request

lookupActionForm

private static ActionForm lookupActionForm(javax.servlet.http.HttpServletRequest request,
                                           java.lang.String attribute,
                                           java.lang.String scope)

canReuseActionForm

private static boolean canReuseActionForm(ActionForm instance,
                                          FormBeanConfig config)
                                   throws java.lang.ClassNotFoundException

Determine whether instance of ActionForm is suitable for re-use as an instance of the form described by config.

パラメータ:
instance - an instance of ActionForm which was found, probably in either request or session scope.
config - the configuration for the ActionForm which is needed.
戻り値:
true if the instance found is "compatible" with the type required in the FormBeanConfig; false if not, or if instance is null.
例外:
java.lang.ClassNotFoundException - if the type property of config is not a valid Class name.

createActionForm

public static ActionForm createActionForm(FormBeanConfig config,
                                          ActionServlet servlet)

Create and return an ActionForm instance appropriate to the information in config.

Does not perform any checks to see if an existing ActionForm exists which could be reused.

パラメータ:
config - The configuration for the Form bean which is to be created.
servlet - The action servlet
戻り値:
ActionForm instance associated with this request

getUserLocale

public static java.util.Locale getUserLocale(javax.servlet.http.HttpServletRequest request,
                                             java.lang.String locale)

Look up and return current user locale, based on the specified parameters.

パラメータ:
request - The request used to lookup the Locale
locale - Name of the session attribute for our user's Locale. If this is null, the default locale key is used for the lookup.
戻り値:
current user locale
導入されたバージョン:
Struts 1.2

populate

public static void populate(java.lang.Object bean,
                            javax.servlet.http.HttpServletRequest request)
                     throws javax.servlet.ServletException

Populate the properties of the specified JavaBean from the specified HTTP request, based on matching each parameter name against the corresponding JavaBeans "property setter" methods in the bean's class. Suitable conversion is done for argument types as described under convert().

パラメータ:
bean - The JavaBean whose properties are to be set
request - The HTTP request whose parameters are to be used to populate bean properties
例外:
javax.servlet.ServletException - if an exception is thrown while setting property values

populate

public static void populate(java.lang.Object bean,
                            java.lang.String prefix,
                            java.lang.String suffix,
                            javax.servlet.http.HttpServletRequest request)
                     throws javax.servlet.ServletException

Populate the properties of the specified JavaBean from the specified HTTP request, based on matching each parameter name (plus an optional prefix and/or suffix) against the corresponding JavaBeans "property setter" methods in the bean's class. Suitable conversion is done for argument types as described under setProperties.

If you specify a non-null prefix and a non-null suffix, the parameter name must match both conditions for its value(s) to be used in populating bean properties. If the request's content type is "multipart/form-data" and the method is "POST", the HttpServletRequest object will be wrapped in a MultipartRequestWrapper

パラメータ:
bean - The JavaBean whose properties are to be set
prefix - The prefix (if any) to be prepend to bean property names when looking for matching parameters
suffix - The suffix (if any) to be appended to bean property names when looking for matching parameters
request - The HTTP request whose parameters are to be used to populate bean properties
例外:
javax.servlet.ServletException - if an exception is thrown while setting property values

getMultipartHandler

private static MultipartRequestHandler getMultipartHandler(javax.servlet.http.HttpServletRequest request)
                                                    throws javax.servlet.ServletException

Try to locate a multipart request handler for this request. First, look for a mapping-specific handler stored for us under an attribute. If one is not present, use the global multipart handler, if there is one.

パラメータ:
request - The HTTP request for which the multipart handler should be found.
戻り値:
the multipart handler to use, or null if none is found.
例外:
javax.servlet.ServletException - if any exception is thrown while attempting to locate the multipart handler.

getAllParametersForMultipartRequest

private static java.util.Map getAllParametersForMultipartRequest(javax.servlet.http.HttpServletRequest request,
                                                                 MultipartRequestHandler multipartHandler)

Create a Map containing all of the parameters supplied for a multipart request, keyed by parameter name. In addition to text and file elements from the multipart body, query string parameters are included as well.

パラメータ:
request - The (wrapped) HTTP request whose parameters are to be added to the map.
multipartHandler - The multipart handler used to parse the request.
戻り値:
the map containing all parameters for this multipart request.

printableURL

public static java.lang.String printableURL(java.net.URL url)

Compute the printable representation of a URL, leaving off the scheme/host/port part if no host is specified. This will typically be the case for URLs that were originally created from relative or context-relative URIs.

パラメータ:
url - URL to render in a printable representation
戻り値:
printable representation of a URL

actionURL

public static java.lang.String actionURL(javax.servlet.http.HttpServletRequest request,
                                         ActionConfig action,
                                         java.lang.String pattern)

Return the context-relative URL that corresponds to the specified ActionConfig, relative to the module associated with the current modules's ModuleConfig.

パラメータ:
request - The servlet request we are processing
action - ActionConfig to be evaluated
pattern - URL pattern used to map the controller servlet
戻り値:
context-relative URL relative to the module
導入されたバージョン:
Struts 1.1

forwardURL

public static java.lang.String forwardURL(javax.servlet.http.HttpServletRequest request,
                                          ForwardConfig forward)

Return the context-relative URL that corresponds to the specified ForwardConfig. The URL is calculated based on the properties of the ForwardConfig instance as follows:

パラメータ:
request - The servlet request we are processing
forward - ForwardConfig to be evaluated
戻り値:
context-relative URL
導入されたバージョン:
Struts 1.1

forwardURL

public static java.lang.String forwardURL(javax.servlet.http.HttpServletRequest request,
                                          ForwardConfig forward,
                                          ModuleConfig moduleConfig)

Return the context-relative URL that corresponds to the specified ForwardConfig. The URL is calculated based on the properties of the ForwardConfig instance as follows:

パラメータ:
request - The servlet request we are processing
forward - ForwardConfig to be evaluated
moduleConfig - Base forward on this module config.
戻り値:
context-relative URL
導入されたバージョン:
Struts 1.2

requestURL

public static java.net.URL requestURL(javax.servlet.http.HttpServletRequest request)
                               throws java.net.MalformedURLException

Return the URL representing the current request. This is equivalent to HttpServletRequest.getRequestURL in Servlet 2.3.

パラメータ:
request - The servlet request we are processing
戻り値:
URL representing the current request
例外:
java.net.MalformedURLException - if a URL cannot be created

serverURL

public static java.net.URL serverURL(javax.servlet.http.HttpServletRequest request)
                              throws java.net.MalformedURLException

Return the URL representing the scheme, server, and port number of the current request. Server-relative URLs can be created by simply appending the server-relative path (starting with '/') to this.

パラメータ:
request - The servlet request we are processing
戻り値:
URL representing the scheme, server, and port number of the current request
例外:
java.net.MalformedURLException - if a URL cannot be created

requestToServerUriStringBuffer

public static java.lang.StringBuffer requestToServerUriStringBuffer(javax.servlet.http.HttpServletRequest request)

Return the string representing the scheme, server, and port number of the current request. Server-relative URLs can be created by simply appending the server-relative path (starting with '/') to this.

パラメータ:
request - The servlet request we are processing
戻り値:
URL representing the scheme, server, and port number of the current request
導入されたバージョン:
Struts 1.2.0

requestToServerStringBuffer

public static java.lang.StringBuffer requestToServerStringBuffer(javax.servlet.http.HttpServletRequest request)

Return StringBuffer representing the scheme, server, and port number of the current request. Server-relative URLs can be created by simply appending the server-relative path (starting with '/') to this.

パラメータ:
request - The servlet request we are processing
戻り値:
URL representing the scheme, server, and port number of the current request
導入されたバージョン:
Struts 1.2.0

createServerStringBuffer

public static java.lang.StringBuffer createServerStringBuffer(java.lang.String scheme,
                                                              java.lang.String server,
                                                              int port)

Return StringBuffer representing the scheme, server, and port number of the current request.

パラメータ:
scheme - The scheme name to use
server - The server name to use
port - The port value to use
戻り値:
StringBuffer in the form scheme: server: port
導入されたバージョン:
Struts 1.2.0

createServerUriStringBuffer

public static java.lang.StringBuffer createServerUriStringBuffer(java.lang.String scheme,
                                                                 java.lang.String server,
                                                                 int port,
                                                                 java.lang.String uri)

Return StringBuffer representing the scheme, server, and port number of the current request.

パラメータ:
scheme - The scheme name to use
server - The server name to use
port - The port value to use
uri - The uri value to use
戻り値:
StringBuffer in the form scheme: server: port
導入されたバージョン:
Struts 1.2.0

selectModule

public static void selectModule(java.lang.String prefix,
                                javax.servlet.http.HttpServletRequest request,
                                javax.servlet.ServletContext context)
推奨されていません。 Use ModuleUtils.selectModule(String,HttpServletRequest,ServletContext) instead. This will be removed after Struts 1.2.

Select the module to which the specified request belongs, and add corresponding request attributes to this request.

パラメータ:
prefix - The module prefix of the desired module
request - The servlet request we are processing
context - The ServletContext for this web application
導入されたバージョン:
Struts 1.1

selectModule

public static void selectModule(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.ServletContext context)
推奨されていません。 Use ModuleUtils.selectModule(HttpServletRequest,ServletContext) instead. This will be removed after Struts 1.2.

Select the module to which the specified request belongs, and add corresponding request attributes to this request.

パラメータ:
request - The servlet request we are processing
context - The ServletContext for this web application

getModuleName

public static java.lang.String getModuleName(javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.ServletContext context)
推奨されていません。 Use Use ModuleUtils.getModuleName(HttpServletRequest,ServletContext) instead. This will be removed after Struts 1.2.

Get the module name to which the specified request belong.

パラメータ:
request - The servlet request we are processing
context - The ServletContext for this web application
戻り値:
The module prefix or ""

getModuleName

public static java.lang.String getModuleName(java.lang.String matchPath,
                                             javax.servlet.ServletContext context)
推奨されていません。 Use ModuleUtils.getModuleName(String,ServletContext) instead. This will be removed after Struts 1.2.

Get the module name to which the specified uri belong.

パラメータ:
matchPath - The uri from which we want the module name.
context - The ServletContext for this web application
戻り値:
The module prefix or ""

getRequestModuleConfig

public static ModuleConfig getRequestModuleConfig(javax.servlet.http.HttpServletRequest request)
推奨されていません。 Use ModuleUtils.getModuleConfig(HttpServletRequest) instead. This will be removed after Struts 1.2.

Return the current ModuleConfig object stored in request, if it exists, null otherwise. This method can be used by a PlugIn to retrieve the current module config object. If no moduleConfig is found, this means that the request hasn't hit the server through the Struts servlet. The appropriate module config can be set and found with selectModule(HttpServletRequest, ServletContext) .

パラメータ:
request - The servlet request we are processing
戻り値:
the ModuleConfig object from request, or null if none is set in the request.
導入されたバージョン:
Struts 1.1

getModuleConfig

public static ModuleConfig getModuleConfig(javax.servlet.http.HttpServletRequest request,
                                           javax.servlet.ServletContext context)
推奨されていません。 Use ModuleUtils.getModuleConfig(HttpServletRequest,ServletContext) instead. This will be removed after Struts 1.2.

Return the ModuleConfig object is it exists, null otherwise.

パラメータ:
request - The servlet request we are processing
context - The ServletContext for this web application
戻り値:
the ModuleConfig object
導入されたバージョン:
Struts 1.1

getModulePrefixes

public static java.lang.String[] getModulePrefixes(javax.servlet.ServletContext context)
推奨されていません。 Use ModuleUtils.getModulePrefixes(ServletContext) instead. This will be removed after Struts 1.2.

Return the list of module prefixes that are defined for this web application. NOTE - the "" prefix for the default module is not included in this list.

パラメータ:
context - The ServletContext for this web application.
戻り値:
An array of module prefixes.
導入されたバージョン:
Struts 1.1

computeParameters

public static java.util.Map computeParameters(javax.servlet.jsp.PageContext pageContext,
                                              java.lang.String paramId,
                                              java.lang.String paramName,
                                              java.lang.String paramProperty,
                                              java.lang.String paramScope,
                                              java.lang.String name,
                                              java.lang.String property,
                                              java.lang.String scope,
                                              boolean transaction)
                                       throws javax.servlet.jsp.JspException
推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.computeParameters(PageContext,String,String,String,String,String,String,String,boolean) instead.

Compute a set of query parameters that will be dynamically added to a generated URL. The returned Map is keyed by parameter name, and the values are either null (no value specified), a String (single value specified), or a String[] array (multiple values specified). Parameter names correspond to the corresponding attributes of the <html:link> tag. If no query parameters are identified, return null.

パラメータ:
pageContext - PageContext we are operating in
paramId - Single-value request parameter name (if any)
paramName - Bean containing single-value parameter value
paramProperty - Property (of bean named by paramName containing single-value parameter value
paramScope - Scope containing bean named by paramName
name - Bean containing multi-value parameters Map (if any)
property - Property (of bean named by name containing multi-value parameters Map
scope - Scope containing bean named by name
transaction - Should we add our transaction control token?
戻り値:
Map of query parameters
例外:
javax.servlet.jsp.JspException - if we cannot look up the required beans
javax.servlet.jsp.JspException - if a class cast exception occurs on a looked-up bean or property

computeURL

public static java.lang.String computeURL(javax.servlet.jsp.PageContext pageContext,
                                          java.lang.String forward,
                                          java.lang.String href,
                                          java.lang.String page,
                                          java.util.Map params,
                                          java.lang.String anchor,
                                          boolean redirect)
                                   throws java.net.MalformedURLException
推奨されていません。 This will be removed after Struts 1.2 Use computeURL(PageContext, String, String, String, String, Map, String, boolean) instead.

Compute a hyperlink URL based on the forward, href or page parameter that is not null.

パラメータ:
pageContext - PageContext for the tag making this call
forward - Logical forward name for which to look up the context-relative URI (if specified)
href - URL to be utilized unmodified (if specified)
page - Module-relative page for which a URL should be created (if specified)
params - Map of parameters to be dynamically included (if any)
anchor - Anchor to be dynamically included (if any)
redirect - Is this URL for a response.sendRedirect()?
戻り値:
URL with session identifier
例外:
java.net.MalformedURLException - if a URL cannot be created for the specified parameters

computeURL

public static java.lang.String computeURL(javax.servlet.jsp.PageContext pageContext,
                                          java.lang.String forward,
                                          java.lang.String href,
                                          java.lang.String page,
                                          java.lang.String action,
                                          java.util.Map params,
                                          java.lang.String anchor,
                                          boolean redirect)
                                   throws java.net.MalformedURLException
推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.computeURL(PageContext,String,String,String,String,String,Map,String, boolean) instead.

Compute a hyperlink URL based on the forward, href, action or page parameter that is not null. The returned URL will have already been passed to response.encodeURL() for adding a session identifier.

パラメータ:
pageContext - PageContext for the tag making this call
forward - Logical forward name for which to look up the context-relative URI (if specified)
href - URL to be utilized unmodified (if specified)
page - Module-relative page for which a URL should be created (if specified)
action - Logical action name for which to look up the context-relative URI (if specified)
params - Map of parameters to be dynamically included (if any)
anchor - Anchor to be dynamically included (if any)
redirect - Is this URL for a response.sendRedirect()?
戻り値:
URL with session identifier
例外:
java.net.MalformedURLException - if a URL cannot be created for the specified parameters

computeURL

public static java.lang.String computeURL(javax.servlet.jsp.PageContext pageContext,
                                          java.lang.String forward,
                                          java.lang.String href,
                                          java.lang.String page,
                                          java.lang.String action,
                                          java.util.Map params,
                                          java.lang.String anchor,
                                          boolean redirect,
                                          boolean encodeSeparator)
                                   throws java.net.MalformedURLException
推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.computeURL(PageContext,String,String,String,String,String,Map,String,boolean,boolean) instead.

Compute a hyperlink URL based on the forward, href, action or page parameter that is not null. The returned URL will have already been passed to response.encodeURL() for adding a session identifier.

パラメータ:
pageContext - PageContext for the tag making this call
forward - Logical forward name for which to look up the context-relative URI (if specified)
href - URL to be utilized unmodified (if specified)
page - Module-relative page for which a URL should be created (if specified)
action - Logical action name for which to look up the context-relative URI (if specified)
params - Map of parameters to be dynamically included (if any)
anchor - Anchor to be dynamically included (if any)
redirect - Is this URL for a response.sendRedirect()?
encodeSeparator - This is only checked if redirect is set to false (never encoded for a redirect). If true, query string parameter separators are encoded as >amp;, else & is used.
戻り値:
URL with session identifier
例外:
java.net.MalformedURLException - if a URL cannot be created for the specified parameters

getActionMappingName

public static java.lang.String getActionMappingName(java.lang.String action)
推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.getActionMappingName(String) instead.

Return the form action converted into an action mapping path. The value of the action property is manipulated as follows in computing the name of the requested mapping:


getActionMappingURL

public static java.lang.String getActionMappingURL(java.lang.String action,
                                                   javax.servlet.jsp.PageContext pageContext)
推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.getActionMappingURL(String,PageContext) instead.

Return the form action converted into a server-relative URL.


lookup

public static java.lang.Object lookup(javax.servlet.jsp.PageContext pageContext,
                                      java.lang.String name,
                                      java.lang.String scopeName)
                               throws javax.servlet.jsp.JspException
推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.lookup(PageContext,String,String) instead.

Locate and return the specified bean, from an optionally specified scope, in the specified page context. If no such bean is found, return null instead. If an exception is thrown, it will have already been saved via a call to saveException.

パラメータ:
pageContext - Page context to be searched
name - Name of the bean to be retrieved
scopeName - Scope to be searched (page, request, session, application) or null to use findAttribute() instead
戻り値:
JavaBean in the specified page context
例外:
javax.servlet.jsp.JspException - if an invalid scope name is requested

getScope

public static int getScope(java.lang.String scopeName)
                    throws javax.servlet.jsp.JspException
推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.getScope(String) instead.

Converts the scope name into its corresponding PageContext constant value.

パラメータ:
scopeName - Can be "page", "request", "session", or "application" in any case
戻り値:
The constant representing the scope (ie. PageContext.REQUEST_SCOPE).
例外:
javax.servlet.jsp.JspException - if the scopeName is not a valid name.
導入されたバージョン:
Struts 1.1

lookup

public static java.lang.Object lookup(javax.servlet.jsp.PageContext pageContext,
                                      java.lang.String name,
                                      java.lang.String property,
                                      java.lang.String scope)
                               throws javax.servlet.jsp.JspException
推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.lookup(PageContext,String,String,String) instead.

Locate and return the specified property of the specified bean, from an optionally specified scope, in the specified page context. If an exception is thrown, it will have already been saved via a call to saveException.

パラメータ:
pageContext - Page context to be searched
name - Name of the bean to be retrieved
property - Name of the property to be retrieved, or null to retrieve the bean itself
scope - Scope to be searched (page, request, session, application) or null to use findAttribute() instead
戻り値:
property of specified JavaBean
例外:
javax.servlet.jsp.JspException - if an invalid scope name is requested
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

retrieveUserLocale

public static java.util.Locale retrieveUserLocale(javax.servlet.jsp.PageContext pageContext,
                                                  java.lang.String locale)
推奨されていません。 This will be removed after Struts 1.2. Use TagUtils.getUserLocale(PageContext,String) instead.

Look up and return current user locale, based on the specified parameters.

パラメータ:
pageContext - The PageContext associated with this request
locale - Name of the session attribute for our user's Locale. If this is null, the default locale key is used for the lookup.
戻り値:
current user locale

message

public static java.lang.String message(javax.servlet.jsp.PageContext pageContext,
                                       java.lang.String bundle,
                                       java.lang.String locale,
                                       java.lang.String key)
                                throws javax.servlet.jsp.JspException
推奨されていません。 Use TagUtils.message(PageContext,String,String,String) instead. This will be removed after Struts 1.2.

Look up and return a message string, based on the specified parameters.

パラメータ:
pageContext - The PageContext associated with this request
bundle - Name of the servlet context attribute for our message resources bundle
locale - Name of the session attribute for our user's Locale
key - Message key to be looked up and returned
戻り値:
message string
例外:
javax.servlet.jsp.JspException - if a lookup error occurs (will have been saved in the request already)

message

public static java.lang.String message(javax.servlet.jsp.PageContext pageContext,
                                       java.lang.String bundle,
                                       java.lang.String locale,
                                       java.lang.String key,
                                       java.lang.Object[] args)
                                throws javax.servlet.jsp.JspException
推奨されていません。 Use TagUtils.message(PageContext,String,String,String,Object[]) instead. This will be removed after Struts 1.2.

Look up and return a message string, based on the specified parameters.

パラメータ:
pageContext - The PageContext associated with this request
bundle - Name of the servlet context attribute for our message resources bundle
locale - Name of the session attribute for our user's Locale
key - Message key to be looked up and returned
args - Replacement parameters for this message
戻り値:
message string
例外:
javax.servlet.jsp.JspException - if a lookup error occurs (will have been saved in the request already)

present

public static boolean present(javax.servlet.jsp.PageContext pageContext,
                              java.lang.String bundle,
                              java.lang.String locale,
                              java.lang.String key)
                       throws javax.servlet.jsp.JspException
推奨されていません。 Use TagUtils.present(PageContext ,String,String,String) instead. This will be removed after Struts 1.2.

Return true if a message string for the specified message key is present for the specified Locale.

パラメータ:
pageContext - The PageContext associated with this request
bundle - Name of the servlet context attribute for our message resources bundle
locale - Name of the session attribute for our user's Locale
key - Message key to be looked up and returned
戻り値:
true if a message string for message key exists
例外:
javax.servlet.jsp.JspException - if a lookup error occurs (will have been saved in the request already)

pageURL

public static java.lang.String pageURL(javax.servlet.http.HttpServletRequest request,
                                       java.lang.String page)
推奨されていません。 Use TagUtils.pageURL(HttpServletRequest request, String page, ModuleConfig moduleConfig) instead. This will be removed after Struts 1.2.

Return the context-relative URL that corresponds to the specified page attribute value, calculated based on the pagePattern property of the current module's ModuleConfig.

パラメータ:
request - The servlet request we are processing
page - The module-relative URL to be substituted in to the pagePattern pattern for the current module (MUST start with a slash)
戻り値:
context-relative URL
導入されたバージョン:
Struts 1.1

saveException

public static void saveException(javax.servlet.jsp.PageContext pageContext,
                                 java.lang.Throwable exception)
推奨されていません。 Use TagUtils.saveException(PageContext,Throwable) instead. This will be removed after Struts 1.2.

Save the specified exception as a request attribute for later use.

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

getModuleConfig

public static ModuleConfig getModuleConfig(javax.servlet.jsp.PageContext pageContext)
推奨されていません。 Use TagUtils.getModuleConfig(PageContext) instead. This will be removed after Struts 1.2.

Return the ModuleConfig object if it exists, null if otherwise.

パラメータ:
pageContext - The page context.
戻り値:
the ModuleConfig object
導入されたバージョン:
Struts 1.1

getActionMessages

public static ActionMessages getActionMessages(javax.servlet.jsp.PageContext pageContext,
                                               java.lang.String paramName)
                                        throws javax.servlet.jsp.JspException
推奨されていません。 Use TagUtils.getActionMessages(PageContext,String) instead. This will be removed after Struts 1.2.

Retrieves the value from request scope and if it isn't already an ActionMessages some classes are converted to one.

パラメータ:
pageContext - The PageContext for the current page
paramName - Key for parameter value
戻り値:
ActionErros in page context.
例外:
javax.servlet.jsp.JspException

getActionErrors

public static ActionErrors getActionErrors(javax.servlet.jsp.PageContext pageContext,
                                           java.lang.String paramName)
                                    throws javax.servlet.jsp.JspException
推奨されていません。 Use TagUtils.getActionErrors(PageContext,String) instead. This will be removed after Struts 1.2.

Retrieves the value from request scope and if it isn't already an ErrorMessages some classes are converted to one.

パラメータ:
pageContext - The PageContext for the current page
paramName - Key for parameter value
戻り値:
ActionErrors from request scope
例外:
javax.servlet.jsp.JspException

encodeURL

public static java.lang.String encodeURL(java.lang.String url)
推奨されていません。 Use TagUtils.encodeURL(String) instead. This will be removed after Struts 1.2.

Use the new URLEncoder.encode method from Java 1.4 if available, else use the old deprecated version. This method uses reflection to find the appropriate method; if the reflection operations throw exceptions, this will return the url encoded with the old URLEncoder.encode method.

戻り値:
String - the encoded url.

isXhtml

public static boolean isXhtml(javax.servlet.jsp.PageContext pageContext)
推奨されていません。 Use TagUtils.isXhtml(PageContext) instead. This will be removed after Struts 1.2.

Returns true if the custom tags are in XHTML mode.

導入されたバージョン:
Struts 1.1


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