| java.lang.Object org.apache.beehive.netui.pageflow.internal.InternalUtils
Method Summary | |
public static void | addActionError(String propertyName, ActionMessage error, ServletRequest request) | public static void | addActionOutputs(Map toAdd, ServletRequest request, boolean overwrite) | public static void | addBindingUpdateError(ServletRequest request, String expression, String message, Throwable cause) Add a BindingUpdateError to the request. | public static String | addParam(String url, String paramName, String paramVal) Add a parameter to the given URL. | public static boolean | avoidDirectResponseOutput(ServletRequest request) Tell whether a special request attribute was set, indicating that we should avoid writing to the response (or
setting response error codes). | public static ActionForm | createActionForm(ActionMapping mapping, ModuleConfig moduleConfig, ActionServlet actionServlet, ServletContext servletContext) | public static String | createActionPath(ServletRequest request, String qualifiedAction) | public static ModuleConfig | ensureModuleConfig(String modulePath, ServletContext context) Get the Struts ModuleConfig for the given module path. | public static ActionConfig | findActionConfig(String actionConfigPath, String modulePath, ServletContext context) Get the Struts ActionConfig for the given action config path and module path. | public static String | getActionMappingName(String action) Return the form action converted into an action mapping path. | public static String | getActionMappingPath(ServletRequest request) Get the Struts ActionMapping path from the ActionMapping that is in the request under the key
Globals.MAPPING_KEY. | public static String | getActionName(ActionMapping mapping) | public static Map | getActionOutputMap(ServletRequest request, boolean createIfNotExist) | public static ActionServlet | getActionServlet(ServletContext context) Get the current ActionServlet. | public static Map | getBindingUpdateErrors(ServletRequest request) Get a map of BindingUpdateErrors stored in the request. | public static String | getCleanActionName(String action, boolean prependSlash) | public static ActionForm | getCurrentActionForm(ServletRequest request) | public static ActionMapping | getCurrentActionMapping(ServletRequest request) | public static String | getDecodedServletPath(HttpServletRequest request) | public static String | getDecodedURI(HttpServletRequest request) | public static FacesBackingBean | getFacesBackingBean(ServletRequest request, ServletContext servletContext) | public static String | getFlowControllerClassName(String modulePath, ServletRequest request, ServletContext context) | public static String | getFlowControllerClassName(ModuleConfig mc) | public static ActionForm | getFormBean(ActionMapping mapping, ServletRequest request) | public static String | getFormBeanType(FormBeanConfig formBeanConfig) | public static ActionForm | getForwardedFormBean(ServletRequest request, boolean removeFromRequest) | public static String | getForwardingModule(ServletRequest request) Set the module prefix for the ModuleConfig that is performing a forward in this request. | public static HttpSession | getHttpSession(ServletRequest request, boolean create) | public static String | getLongLivedFlowAttr(String modulePath) | public static MessageResources | getMessageResources(String bundleName, ServletRequest request, ServletContext servletContext) | public static ModuleConfig | getModuleConfig(String modulePath, ServletContext context) Get the Struts ModuleConfig for the given module path. | public static String | getModulePathFromReqAttr(HttpServletRequest request) Gets the Struts module path from the input request. | public static MultipartHandler | getMultipartHandlerType() | public static Map | getPageInputMap(ServletRequest request, ServletContext servletContext) | public static Map | getPageInputMap(ServletRequest request) | public static String | getQualifiedBundleName(String bundleName, ServletRequest request) Qualify the given bundle name with the current module path to return a full bundle name. | public static Class | getReloadableClass(String className, ServletContext servletContext) | public static ServletContext | getServletContext(ServletRequest req) | public static boolean | ignoreIncludeServletPath(ServletRequest request) | public static String | inferModulePathFromClassName(String className) | public static void | initDelegatingConfigs(ModuleConfig moduleConfig, ServletContext servletContext) Initialize delegating action configs and exception configs for a Struts module that should delegate
to one generated from a superclass. | public static boolean | isLongLived(ModuleConfig moduleConfig) Tell whether the given module is a long-lived page flow. | public static boolean | isMultipartHandlingEnabled(ServletRequest request) | public static boolean | isNestable(ModuleConfig moduleConfig) Tell whether the given module is a nested page flow. | public static boolean | isSessionScope(ActionMapping mapping) | public static boolean | isSharedFlowModule(ModuleConfig mc) | public static Field | lookupField(Class parentClass, String fieldName) Get a Field in a Class.
Parameters: parentClass - the Class in which to find the Field. Parameters: fieldName - the name of the Field. | public static Locale | lookupLocale(JspContext jspContext) | public static Locale | lookupLocale(ServletRequest request) | public static Method | lookupMethod(Class parentClass, String methodName, Class[] signature) Get a Method in a Class.
Parameters: parentClass - the Class in which to find the Method. Parameters: methodName - the name of the Method. Parameters: signature - the argument types for the Method. | public static Object | newReloadableInstance(String className, ServletContext servletContext) | public static String | qualifyAction(ServletContext servletContext, String action) | public static void | removeCurrentFacesBackingBean(HttpServletRequest request, ServletContext servletContext) | public static void | removeCurrentPageFlow(HttpServletRequest request, ServletContext servletContext) | public static ModuleConfig | selectModule(String prefix, HttpServletRequest request, ServletContext servletContext) Set the given Struts module in the request, and expose its set of MessageResources as request attributes.
Parameters: prefix - the prefix of the desired module. Parameters: request - the current HttpServletRequest. Parameters: servletContext - the current ServletContext. | public static void | sendDevTimeError(String messageKey, Throwable cause, int productionTimeErrorCode, ServletRequest request, ServletResponse response, ServletContext servletContext, Object[] messageArgs) If not in production mode, write an error to the response; otherwise, set a response error code. | public static void | sendDevTimeError(String messageKey, Object[] messageArgs, Throwable cause, int productionTimeErrorCode, ServletRequest request, ServletResponse response, ServletContext servletContext) If not in production mode, write an error to the response; otherwise, set a response error code. | public static void | sendError(String messageKey, Throwable cause, ServletRequest request, HttpServletResponse response, Object[] messageArgs) Write an error to the response. | public static void | sendError(String messageKey, Object[] messageArgs, ServletRequest request, ServletResponse response, Throwable cause, boolean avoidDirectResponseOutput) Write an error to the response. | public static boolean | sessionExpired(ServletRequest servletRequest) | public static void | setAvoidDirectResponseOutput(ServletRequest request) Set a special request attribute to indicate that we should avoid writing to the response (or
setting response error codes). | public static void | setCurrentActionResolver(ActionResolver resolver, HttpServletRequest request, ServletContext servletContext) Set the current
ActionResolver (or
PageFlowController ) in the user session. | public static void | setCurrentModule(ModuleConfig mc, ServletRequest request) | public static void | setCurrentPageFlow(PageFlowController jpf, HttpServletRequest request, ServletContext servletContext) | public static void | setFormInScope(String formName, ActionForm form, ActionMapping mapping, HttpServletRequest request, boolean overwrite) Set the given form in either the request or session, as appropriate, so Struts/NetUI
tags will have access to it. | public static void | setForwardedFormBean(ServletRequest request, ActionForm form) Set the forwarded form. | public static void | setForwardingModule(ServletRequest request, String modulePrefix) Set the module prefix for the ModuleConfig that is performing a forward in this request. | public static void | setIgnoreIncludeServletPath(ServletRequest request, boolean ignore) Tell
InternalUtils.getDecodedServletPath (and all that call it) to ignore the attribute that specifies the Servlet
Include path, which is set when a Servlet include is done through RequestDispatcher. | public static void | setServletContext(ServletRequest request, ServletContext servletContext) | public static void | throwPageFlowException(PageFlowException ex) | public static void | throwPageFlowException(PageFlowException effect, ServletRequest request) | public static Object | unwrapFormBean(ActionForm form) We unwrap two special form types: XmlBeanActionForm and AnyBeanActionForm. | public static ServletRequest | unwrapMultipart(ServletRequest request) If the given request is a MultipartRequestWrapper (Struts class that doesn't extend
HttpServletRequestWrapper), return the wrapped request; otherwise, return the given request. | public static ActionForm | wrapFormBean(Object formBean) |
addBindingUpdateError | public static void addBindingUpdateError(ServletRequest request, String expression, String message, Throwable cause)(Code) | | Add a BindingUpdateError to the request.
Parameters: request - the current ServletRequest. Parameters: expression - the expression associated with this error. Parameters: message - the error message. Parameters: cause - the Throwable that caused the error. |
addParam | public static String addParam(String url, String paramName, String paramVal)(Code) | | Add a parameter to the given URL. Assumes there is no trailing
anchor/fragment indicated with a '#'.
Parameters: url - the URL to which to append. Parameters: paramName - the name of the parameter to add. Parameters: paramVal - the value of the parameter to add. the URL, with the given parameter added. |
avoidDirectResponseOutput | public static boolean avoidDirectResponseOutput(ServletRequest request)(Code) | | Tell whether a special request attribute was set, indicating that we should avoid writing to the response (or
setting response error codes).
|
createActionForm | public static ActionForm createActionForm(ActionMapping mapping, ModuleConfig moduleConfig, ActionServlet actionServlet, ServletContext servletContext)(Code) | | |
ensureModuleConfig | public static ModuleConfig ensureModuleConfig(String modulePath, ServletContext context)(Code) | | Get the Struts ModuleConfig for the given module path. If there is none registered,
and if it is possible to register one automatically, do so.
|
findActionConfig | public static ActionConfig findActionConfig(String actionConfigPath, String modulePath, ServletContext context)(Code) | | Get the Struts ActionConfig for the given action config path and module path.
|
getActionMappingName | public static String getActionMappingName(String action)(Code) | | 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:
- Any filename extension is removed (on the theory that extension
mapping is being used to select the controller servlet).
- If the resulting value does not start with a slash, then a
slash is prepended.
Parameters: action - the action name to be converted. an action path, suitable for lookup in the Struts configuration file. |
getActionMappingPath | public static String getActionMappingPath(ServletRequest request)(Code) | | Get the Struts ActionMapping path from the ActionMapping that is in the request under the key
Globals.MAPPING_KEY.
the path for the ActionMapping, as found with ActionMapping.getPath() |
getActionName | public static String getActionName(ActionMapping mapping)(Code) | | |
getActionServlet | public static ActionServlet getActionServlet(ServletContext context)(Code) | | Get the current ActionServlet.
Parameters: context - the current ServletContext the ActionServlet that is stored as an attribute in the ServletContext |
getBindingUpdateErrors | public static Map getBindingUpdateErrors(ServletRequest request)(Code) | | Get a map of BindingUpdateErrors stored in the request.
a Map of expression (String) -> BindingUpdateError. |
getCleanActionName | public static String getCleanActionName(String action, boolean prependSlash)(Code) | | |
getCurrentActionMapping | public static ActionMapping getCurrentActionMapping(ServletRequest request)(Code) | | |
getFlowControllerClassName | public static String getFlowControllerClassName(ModuleConfig mc)(Code) | | |
getFormBean | public static ActionForm getFormBean(ActionMapping mapping, ServletRequest request)(Code) | | |
getFormBeanType | public static String getFormBeanType(FormBeanConfig formBeanConfig)(Code) | | |
getForwardedFormBean | public static ActionForm getForwardedFormBean(ServletRequest request, boolean removeFromRequest)(Code) | | |
getForwardingModule | public static String getForwardingModule(ServletRequest request)(Code) | | Set the module prefix for the ModuleConfig that is performing a forward in this request.
|
getModuleConfig | public static ModuleConfig getModuleConfig(String modulePath, ServletContext context)(Code) | | Get the Struts ModuleConfig for the given module path.
|
getModulePathFromReqAttr | public static String getModulePathFromReqAttr(HttpServletRequest request)(Code) | | Gets the Struts module path from the input request. If a ModuleConfig
object has been populated into the request it is used to get the module prefix,
otherwise getModulePath is called, which derives the module path from
the request URI.
|
getQualifiedBundleName | public static String getQualifiedBundleName(String bundleName, ServletRequest request)(Code) | | Qualify the given bundle name with the current module path to return a full bundle name.
the qualified Bundle name |
ignoreIncludeServletPath | public static boolean ignoreIncludeServletPath(ServletRequest request)(Code) | | |
inferModulePathFromClassName | public static String inferModulePathFromClassName(String className)(Code) | | |
initDelegatingConfigs | public static void initDelegatingConfigs(ModuleConfig moduleConfig, ServletContext servletContext)(Code) | | Initialize delegating action configs and exception configs for a Struts module that should delegate
to one generated from a superclass.
|
isLongLived | public static boolean isLongLived(ModuleConfig moduleConfig)(Code) | | Tell whether the given module is a long-lived page flow.
|
isMultipartHandlingEnabled | public static boolean isMultipartHandlingEnabled(ServletRequest request)(Code) | | |
isNestable | public static boolean isNestable(ModuleConfig moduleConfig)(Code) | | Tell whether the given module is a nested page flow.
|
isSessionScope | public static boolean isSessionScope(ActionMapping mapping)(Code) | | |
isSharedFlowModule | public static boolean isSharedFlowModule(ModuleConfig mc)(Code) | | |
lookupField | public static Field lookupField(Class parentClass, String fieldName)(Code) | | Get a Field in a Class.
Parameters: parentClass - the Class in which to find the Field. Parameters: fieldName - the name of the Field. the Field with the given name, or null if the field does not exist. |
lookupMethod | public static Method lookupMethod(Class parentClass, String methodName, Class[] signature)(Code) | | Get a Method in a Class.
Parameters: parentClass - the Class in which to find the Method. Parameters: methodName - the name of the Method. Parameters: signature - the argument types for the Method. the Method with the given name and signature, or null if the method does not exist. |
selectModule | public static ModuleConfig selectModule(String prefix, HttpServletRequest request, ServletContext servletContext)(Code) | | Set the given Struts module in the request, and expose its set of MessageResources as request attributes.
Parameters: prefix - the prefix of the desired module. Parameters: request - the current HttpServletRequest. Parameters: servletContext - the current ServletContext. the selected ModuleConfig, or null if there is none for the given module prefix. |
sendDevTimeError | public static void sendDevTimeError(String messageKey, Object[] messageArgs, Throwable cause, int productionTimeErrorCode, ServletRequest request, ServletResponse response, ServletContext servletContext) throws IOException(Code) | | If not in production mode, write an error to the response; otherwise, set a response error code.
InternalUtils.sendDevTimeError(String,Throwable,int,ServletRequest,ServletResponse,ServletContext,Object[]) |
setAvoidDirectResponseOutput | public static void setAvoidDirectResponseOutput(ServletRequest request)(Code) | | Set a special request attribute to indicate that we should avoid writing to the response (or
setting response error codes).
|
setFormInScope | public static void setFormInScope(String formName, ActionForm form, ActionMapping mapping, HttpServletRequest request, boolean overwrite)(Code) | | Set the given form in either the request or session, as appropriate, so Struts/NetUI
tags will have access to it.
|
setForwardedFormBean | public static void setForwardedFormBean(ServletRequest request, ActionForm form)(Code) | | Set the forwarded form. This overrides the auto-generated form created by processActionForm
and populated by processPopulate (in PageFlowRequestProcessor).
|
setForwardingModule | public static void setForwardingModule(ServletRequest request, String modulePrefix)(Code) | | Set the module prefix for the ModuleConfig that is performing a forward in this request.
|
setIgnoreIncludeServletPath | public static void setIgnoreIncludeServletPath(ServletRequest request, boolean ignore)(Code) | | Tell
InternalUtils.getDecodedServletPath (and all that call it) to ignore the attribute that specifies the Servlet
Include path, which is set when a Servlet include is done through RequestDispatcher. Normally,
getDecodedServletPath tries the Servlet Include path before falling back to getServletPath() on the request.
Note that this is basically a stack of instructions to ignore the include path, and this method expects each
call with ignore ==true to be balanced by a call with
ignore ==false .
|
unwrapFormBean | public static Object unwrapFormBean(ActionForm form)(Code) | | We unwrap two special form types: XmlBeanActionForm and AnyBeanActionForm.
|
unwrapMultipart | public static ServletRequest unwrapMultipart(ServletRequest request)(Code) | | If the given request is a MultipartRequestWrapper (Struts class that doesn't extend
HttpServletRequestWrapper), return the wrapped request; otherwise, return the given request.
|
wrapFormBean | public static ActionForm wrapFormBean(Object formBean)(Code) | | |
|
|