| java.lang.Object org.apache.struts.util.ModuleUtils
ModuleUtils | public class ModuleUtils (Code) | | General purpose utility methods related to module processing.
version: $Rev: 471754 $ since: Struts 1.2 |
Constructor Summary | |
protected | ModuleUtils() Constructor for ModuleUtils. |
Method Summary | |
public static ModuleUtils | getInstance() Returns the Singleton instance of TagUtils. | public ModuleConfig | getModuleConfig(HttpServletRequest request) Return the current ModuleConfig object stored in request, if it exists,
null otherwise. | public ModuleConfig | getModuleConfig(String prefix, ServletContext context) Return the desired ModuleConfig object stored in context, if it exists,
null otherwise. | public ModuleConfig | getModuleConfig(String prefix, HttpServletRequest request, ServletContext context) | public ModuleConfig | getModuleConfig(HttpServletRequest request, ServletContext context) Return the ModuleConfig object is it exists, null otherwise. | public String | getModuleName(HttpServletRequest request, ServletContext context) Get the module name to which the specified request belong. | public String | getModuleName(String matchPath, ServletContext context) Get the module name to which the specified uri belong. | public String[] | getModulePrefixes(ServletContext context) Return the list of module prefixes that are defined for this web
application. | public void | selectModule(HttpServletRequest request, ServletContext context) Select the module to which the specified request belongs, and add
corresponding request attributes to this request. | public void | selectModule(String prefix, HttpServletRequest request, ServletContext context) Select the module to which the specified request belongs, and add
corresponding request attributes to this request. |
ModuleUtils | protected ModuleUtils()(Code) | | Constructor for ModuleUtils.
|
getInstance | public static ModuleUtils getInstance()(Code) | | Returns the Singleton instance of TagUtils.
|
getModuleConfig | public ModuleConfig getModuleConfig(HttpServletRequest request)(Code) | | 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
ModuleUtils.selectModule(HttpServletRequestServletContext) .
Parameters: request - The servlet request we are processing the ModuleConfig object from request, or null if none is set inthe request. |
getModuleConfig | public ModuleConfig getModuleConfig(String prefix, ServletContext context)(Code) | | Return the desired ModuleConfig object stored in context, if it exists,
null otherwise.
Parameters: prefix - The module prefix of the desired module Parameters: context - The ServletContext for this web application the ModuleConfig object specified, or null if not found in thecontext. |
getModuleConfig | public ModuleConfig getModuleConfig(String prefix, HttpServletRequest request, ServletContext context)(Code) | | Return the desired ModuleConfig object stored in context, if it exists,
otherwise return the current ModuleConfig
Parameters: prefix - The module prefix of the desired module Parameters: request - The servlet request we are processing Parameters: context - The ServletContext for this web application the ModuleConfig object specified, or null if not found in thecontext. |
getModuleConfig | public ModuleConfig getModuleConfig(HttpServletRequest request, ServletContext context)(Code) | | Return the ModuleConfig object is it exists, null otherwise.
Parameters: request - The servlet request we are processing Parameters: context - The ServletContext for this web application the ModuleConfig object |
getModuleName | public String getModuleName(HttpServletRequest request, ServletContext context)(Code) | | Get the module name to which the specified request belong.
Parameters: request - The servlet request we are processing Parameters: context - The ServletContext for this web application The module prefix or "" |
getModuleName | public String getModuleName(String matchPath, ServletContext context)(Code) | | Get the module name to which the specified uri belong.
Parameters: matchPath - The uri from which we want the module name. Parameters: context - The ServletContext for this web application The module prefix or "" |
getModulePrefixes | public String[] getModulePrefixes(ServletContext context)(Code) | | 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.
Parameters: context - The ServletContext for this web application. An array of module prefixes. |
selectModule | public void selectModule(HttpServletRequest request, ServletContext context)(Code) | | Select the module to which the specified request belongs, and add
corresponding request attributes to this request.
Parameters: request - The servlet request we are processing Parameters: context - The ServletContext for this web application |
selectModule | public void selectModule(String prefix, HttpServletRequest request, ServletContext context)(Code) | | Select the module to which the specified request belongs, and add
corresponding request attributes to this request.
Parameters: prefix - The module prefix of the desired module Parameters: request - The servlet request we are processing Parameters: context - The ServletContext for this web application |
|
|