org.apache.struts.util
クラス ModuleUtils

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

public class ModuleUtils
extends java.lang.Object

General purpose utility methods related to module processing.

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

フィールドの概要
private static ModuleUtils instance
          The Singleton instance.
private static org.apache.commons.logging.Log log
          Commons logging instance.
 
コンストラクタの概要
protected ModuleUtils()
          Constructor for ModuleUtils.
 
メソッドの概要
static ModuleUtils getInstance()
          Returns the Singleton instance of TagUtils.
 ModuleConfig getModuleConfig(javax.servlet.http.HttpServletRequest request)
          Return the current ModuleConfig object stored in request, if it exists, null otherwise.
 ModuleConfig getModuleConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext context)
          Return the ModuleConfig object is it exists, null otherwise.
 ModuleConfig getModuleConfig(java.lang.String prefix, javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext context)
          Return the desired ModuleConfig object stored in context, if it exists, otherwise return the current ModuleConfig
 ModuleConfig getModuleConfig(java.lang.String prefix, javax.servlet.ServletContext context)
          Return the desired ModuleConfig object stored in context, if it exists, null otherwise.
 java.lang.String getModuleName(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext context)
          Get the module name to which the specified request belong.
 java.lang.String getModuleName(java.lang.String matchPath, javax.servlet.ServletContext context)
          Get the module name to which the specified uri belong.
 java.lang.String[] getModulePrefixes(javax.servlet.ServletContext context)
          Return the list of module prefixes that are defined for this web application.
 void selectModule(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext context)
          Select the module to which the specified request belongs, and add corresponding request attributes to this request.
 void selectModule(java.lang.String prefix, javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext context)
          Select the module to which the specified request belongs, and add corresponding request attributes to this request.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

instance

private static final ModuleUtils instance
The Singleton instance.


log

private static final org.apache.commons.logging.Log log
Commons logging instance.

コンストラクタの詳細

ModuleUtils

protected ModuleUtils()
Constructor for ModuleUtils.

メソッドの詳細

getInstance

public static ModuleUtils getInstance()
Returns the Singleton instance of TagUtils.


getModuleConfig

public ModuleConfig getModuleConfig(javax.servlet.http.HttpServletRequest request)
Return the current ModuleConfig object stored in request, if it exists, null otherwise. This method can be used by plugin to retrieve the current module config object. If no moduleConfig is found, this means that the request haven't hit the server throught the struts servlet. The appropriate module config can be set and found with RequestUtils.selectModule(HttpServletRequest, ServletContext) .

パラメータ:
request - The servlet request we are processing
戻り値:
the ModuleConfig object from request, or null if none is set in the request.

getModuleConfig

public ModuleConfig getModuleConfig(java.lang.String prefix,
                                    javax.servlet.ServletContext context)
Return the desired ModuleConfig object stored in context, if it exists, null otherwise.

パラメータ:
prefix - The module prefix of the desired module
context - The ServletContext for this web application
戻り値:
the ModuleConfig object specified, or null if not found in the context.

getModuleConfig

public ModuleConfig getModuleConfig(java.lang.String prefix,
                                    javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.ServletContext context)
Return the desired ModuleConfig object stored in context, if it exists, otherwise return the current ModuleConfig

パラメータ:
prefix - The module prefix of the desired module
request - The servlet request we are processing
context - The ServletContext for this web application
戻り値:
the ModuleConfig object specified, or null if not found in the context.

getModuleConfig

public ModuleConfig getModuleConfig(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.ServletContext context)
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

getModuleName

public java.lang.String getModuleName(javax.servlet.http.HttpServletRequest request,
                                      javax.servlet.ServletContext context)
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 java.lang.String getModuleName(java.lang.String matchPath,
                                      javax.servlet.ServletContext context)
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 ""

getModulePrefixes

public java.lang.String[] getModulePrefixes(javax.servlet.ServletContext context)
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.

selectModule

public void selectModule(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.ServletContext context)
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

selectModule

public void selectModule(java.lang.String prefix,
                         javax.servlet.http.HttpServletRequest request,
                         javax.servlet.ServletContext context)
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


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