org.apache.struts.util
Class ModuleUtils
java.lang.Object
org.apache.struts.util.ModuleUtils
public class ModuleUtils
extends java.lang.Object
General purpose utility methods related to module processing.
static ModuleUtils | getInstance() - Returns the Singleton instance of TagUtils.
|
ModuleConfig | getModuleConfig(HttpServletRequest request) - Return the current ModuleConfig object stored in request, if it exists,
null otherwise.
|
ModuleConfig | getModuleConfig(HttpServletRequest request, ServletContext context) - Return the ModuleConfig object is it exists, null otherwise.
|
ModuleConfig | getModuleConfig(String prefix, HttpServletRequest request, ServletContext context) - Return the desired ModuleConfig object stored in context, if it exists,
otherwise return the current ModuleConfig
|
ModuleConfig | getModuleConfig(String prefix, ServletContext context) - Return the desired ModuleConfig object stored in context, if it exists,
null otherwise.
|
String | getModuleName(HttpServletRequest request, ServletContext context) - Get the module name to which the specified request belong.
|
String | getModuleName(String matchPath, ServletContext context) - Get the module name to which the specified uri belong.
|
String[] | getModulePrefixes(ServletContext context) - Return the list of module prefixes that are defined for
this web application.
|
void | selectModule(HttpServletRequest request, ServletContext context) - Select the module to which the specified request belongs, and
add corresponding request attributes to this request.
|
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.
|
instance
private static final ModuleUtils instance
The Singleton instance.
log
private static final 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(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(HttpServletRequest request,
ServletContext context)
Return the ModuleConfig object is it exists, null otherwise.
request
- The servlet request we are processingcontext
- The ServletContext for this web application
getModuleConfig
public ModuleConfig getModuleConfig(String prefix,
HttpServletRequest request,
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 modulerequest
- The servlet request we are processingcontext
- The ServletContext for this web application
- the ModuleConfig object specified, or null if not found in
the context.
getModuleConfig
public ModuleConfig getModuleConfig(String prefix,
ServletContext context)
Return the desired ModuleConfig object stored in context, if it exists,
null otherwise.
prefix
- The module prefix of the desired modulecontext
- The ServletContext for this web application
- the ModuleConfig object specified, or null if not found in
the context.
getModuleName
public String getModuleName(HttpServletRequest request,
ServletContext context)
Get the module name to which the specified request belong.
request
- The servlet request we are processingcontext
- The ServletContext for this web application
getModuleName
public String getModuleName(String matchPath,
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
getModulePrefixes
public String[] getModulePrefixes(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(HttpServletRequest request,
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 processingcontext
- The ServletContext for this web application
selectModule
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.
prefix
- The module prefix of the desired modulerequest
- The servlet request we are processingcontext
- The ServletContext for this web application
Copyright B) 2000-2007 - The Apache Software Foundation