|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectInternalUtils
public class InternalUtils
Field Summary |
---|
Constructor Summary | |
---|---|
InternalUtils()
|
Method Summary | |
---|---|
static void |
addActionOutputs(Map toAdd,
ServletRequest request,
boolean overwrite)
|
static void |
addBindingUpdateError(ServletRequest request,
String expression,
String message,
Throwable cause)
Add a BindingUpdateError to the request. |
static void |
addValidationError(String propertyName,
ActionError error,
ServletRequest request)
|
static ActionForm |
createActionForm(HttpServletRequest request,
ActionMapping mapping,
ModuleConfig moduleConfig,
ActionServlet actionServlet,
ServletContext servletContext)
|
static void |
deleteCurrentPageFlow(HttpServletRequest request)
|
static void |
dumpRequest(HttpServletRequest request,
PrintStream output)
Print parameters and attributes in the given request. |
static void |
dumpServletContext(ServletContext context,
PrintStream output)
Print attributes in the given ServletContext. |
static PageFlowController |
ensureCurrentPageFlow(HttpServletRequest request,
HttpServletResponse response)
Get or create the current PageFlowConroller for the given request. |
static ModuleConfig |
ensureModuleConfig(String modulePath,
ServletRequest request,
ServletContext context)
Get the Struts ModuleConfig for the given module path. |
static SharedFlowController |
ensureSharedFlow(HttpServletRequest request,
HttpServletResponse response)
Get or create the current SharedFlowController instance. |
static SharedFlowController |
ensureSharedFlow(HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
Get or create the current SharedFlowController instance. |
static String |
getActionName(ActionMapping mapping)
|
static Map |
getActionOutputMap(ServletRequest request,
boolean createIfNotExist)
|
static ActionServlet |
getActionServlet(ServletContext context)
Get the current ActionServlet. |
static Map |
getBindingUpdateErrors(ServletRequest request)
Get a map of BindingUpdateErrors stored in the request. |
static ActionResolver |
getCurrentActionResolver(HttpServletRequest request,
boolean warnAboutClassLoaders)
Get the current ActionResolver ( PageFlowController ). |
static PageFlowController |
getCurrentPageFlow(HttpServletRequest request,
boolean warnAboutClassLoaders)
Get the current PageFlowController. |
static String |
getDecodedServletPath(HttpServletRequest request)
|
static String |
getDecodedURI(HttpServletRequest request)
|
static FacesBackingBean |
getFacesBackingBean(ServletRequest request)
|
static FlowController |
getFlowController(Class fcClass,
HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
|
static String |
getFlowControllerClassName(ModuleConfig mc)
|
static String |
getFlowControllerClassName(String modulePath,
ServletRequest request,
ServletContext context)
|
static ActionForm |
getFormBean(ActionMapping mapping,
HttpServletRequest request)
|
static ModuleConfig |
getModuleConfig(String modulePath,
ServletContext context)
Get the Struts ModuleConfig for the given module path. |
static PageflowConfig.MultipartHandler.Enum |
getMultipartHandlerType()
|
static Map |
getPageInputMap(ServletRequest request)
|
static Class |
getReloadableClass(String className,
HttpServletRequest request,
ServletContext servletContext)
|
static ServletContext |
getServletContext(HttpServletRequest request)
|
static SharedFlowController |
getSharedFlow(FlowController pfc,
HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
|
static String |
getSharedFlowClassName(HttpServletRequest request,
ServletContext servletContext)
|
static String |
getSharedFlowClassNameForRelativeURI(String relativeURI,
HttpServletRequest request,
ServletContext servletContext)
|
static ModuleConfig |
getSharedFlowConfig(ModuleConfig flowControllerConfig,
HttpServletRequest request,
ServletContext servletContext)
Get the Struts ModuleConfig associated with the SharedFlowController for the given FlowController module. |
static String |
getSingletonFlowAttr(String modulePath)
|
static PageFlowController |
getSingletonPageFlow(String modulePath,
HttpServletRequest request,
boolean warnAboutClassLoaders)
Get the singleton page flow instance associated with the given module (directory) path. |
static String |
inferModulePathFromClassName(String className)
|
static boolean |
isMultipartHandlingEnabled(HttpServletRequest request)
|
static boolean |
isNestable(ModuleConfig moduleConfig)
Tell whether the given module is a nested page flow. |
static boolean |
isSessionScope(ActionMapping mapping)
|
static boolean |
isSharedFlowModule(ModuleConfig mc)
|
static boolean |
isSingleton(ModuleConfig moduleConfig)
Tell whether the given module is a singleton page flow. |
static Method |
lookupMethod(Class parentClass,
String methodName,
Class[] signature)
Get a Method in a Class. |
static Object |
newReloadableInstance(String className,
HttpServletRequest request,
ServletContext servletContext)
|
static void |
sendDevTimeError(String messageKey,
Object[] messageArgs,
Throwable cause,
int productionTimeErrorCode,
HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
If not in production mode, write an error to the response; otherwise, set a response error code. |
static void |
sendDevTimeError(String messageKey,
Throwable cause,
int productionTimeErrorCode,
HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext,
Object... messageArgs)
If not in production mode, write an error to the response; otherwise, set a response error code. |
static void |
sendError(String messageKey,
Object[] messageArgs,
HttpServletRequest request,
HttpServletResponse response,
Throwable cause)
Write an error to the response. |
static void |
sendError(String messageKey,
Throwable cause,
HttpServletRequest request,
HttpServletResponse response,
Object... messageArgs)
Write an error to the response. |
static void |
setCurrentActionResolver(ActionResolver resolver,
HttpServletRequest request)
Set the current ActionResolver ( PageFlowController ) in the user session. |
static void |
setCurrentModule(ModuleConfig mc,
ServletRequest request)
|
static void |
setCurrentPageFlow(PageFlowController jpf,
HttpServletRequest request)
|
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. |
static Object |
unwrapFormBean(ActionForm form)
We unwrap two special form types: XmlBeanActionForm and AnyBeanActionForm. |
static void |
warnAboutClassLoaders(Object object,
HttpServletRequest request)
|
static void |
warnAboutClassLoaders(Object object,
ServletContext servletContext)
|
static ActionForm |
wrapFormBean(Object formBean)
|
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InternalUtils()
Method Detail |
---|
public static void sendDevTimeError(String messageKey, Throwable cause, int productionTimeErrorCode, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext, Object... messageArgs) throws IOException
IOException
public static void sendDevTimeError(String messageKey, Object[] messageArgs, Throwable cause, int productionTimeErrorCode, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) throws IOException
IOException
public static void sendError(String messageKey, Throwable cause, HttpServletRequest request, HttpServletResponse response, Object... messageArgs) throws IOException
IOException
public static void sendError(String messageKey, Object[] messageArgs, HttpServletRequest request, HttpServletResponse response, Throwable cause) throws IOException
IOException
public static Object unwrapFormBean(ActionForm form)
public static ActionForm wrapFormBean(Object formBean)
public static Method lookupMethod(Class parentClass, String methodName, Class[] signature)
parentClass
- the Class in which to find the Method.methodName
- the name of the Method.signature
- the argument types for the Method.
null
if the method does not exist.public static final PageFlowController ensureCurrentPageFlow(HttpServletRequest request, HttpServletResponse response)
request
- the current HttpServletRequest.response
- the current HttpServletResponse
null
.public static String getFlowControllerClassName(String modulePath, ServletRequest request, ServletContext context)
public static String getFlowControllerClassName(ModuleConfig mc)
public static ActionResolver getCurrentActionResolver(HttpServletRequest request, boolean warnAboutClassLoaders)
PageFlowController
).
null
if there is none.public static void warnAboutClassLoaders(Object object, HttpServletRequest request)
public static void warnAboutClassLoaders(Object object, ServletContext servletContext)
public static final PageFlowController getCurrentPageFlow(HttpServletRequest request, boolean warnAboutClassLoaders)
request
- the current HttpServletRequest.
null
if there is none.public static PageFlowController getSingletonPageFlow(String modulePath, HttpServletRequest request, boolean warnAboutClassLoaders)
modulePath
- the webapp-relative path to the directory containing the singleton page flow.request
- the current HttpServletRequest.
null
if none is found.public static boolean isSingleton(ModuleConfig moduleConfig)
public static boolean isNestable(ModuleConfig moduleConfig)
public static String getSingletonFlowAttr(String modulePath)
public static void setCurrentPageFlow(PageFlowController jpf, HttpServletRequest request)
public static void deleteCurrentPageFlow(HttpServletRequest request)
public static String getDecodedURI(HttpServletRequest request)
public static String getDecodedServletPath(HttpServletRequest request)
public static void addActionOutputs(Map toAdd, ServletRequest request, boolean overwrite)
public static void addValidationError(String propertyName, ActionError error, ServletRequest request)
public static String getActionName(ActionMapping mapping)
public static Object newReloadableInstance(String className, HttpServletRequest request, ServletContext servletContext) throws ClassNotFoundException, InstantiationException, IllegalAccessException
ClassNotFoundException
InstantiationException
IllegalAccessException
public static Class getReloadableClass(String className, HttpServletRequest request, ServletContext servletContext) throws ClassNotFoundException
ClassNotFoundException
public static Map getActionOutputMap(ServletRequest request, boolean createIfNotExist)
public static Map getPageInputMap(ServletRequest request)
public static ModuleConfig getSharedFlowConfig(ModuleConfig flowControllerConfig, HttpServletRequest request, ServletContext servletContext)
public static ModuleConfig getModuleConfig(String modulePath, ServletContext context)
public static ModuleConfig ensureModuleConfig(String modulePath, ServletRequest request, ServletContext context) throws IOException, ServletException
IOException
ServletException
public static ActionServlet getActionServlet(ServletContext context)
context
- the current ServletContext
public static void addBindingUpdateError(ServletRequest request, String expression, String message, Throwable cause)
request
- the current ServletRequest.expression
- the expression associated with this error.message
- the error message.cause
- the Throwable that caused the error.public static Map getBindingUpdateErrors(ServletRequest request)
public static void dumpRequest(HttpServletRequest request, PrintStream output)
request
- the current HttpServletRequest.output
- a PrintStream to which to output request parameters and request/session
attributes; if null, System.err
is used.
public static void dumpServletContext(ServletContext context, PrintStream output)
context
- the current ServletContext.output
- a PrintStream to which to output ServletContext attributes; if null,
System.err
is used.
public static void setCurrentModule(ModuleConfig mc, ServletRequest request)
public static ActionForm createActionForm(HttpServletRequest request, ActionMapping mapping, ModuleConfig moduleConfig, ActionServlet actionServlet, ServletContext servletContext)
public static void setFormInScope(String formName, ActionForm form, ActionMapping mapping, HttpServletRequest request, boolean overwrite)
public static boolean isSessionScope(ActionMapping mapping)
public static ActionForm getFormBean(ActionMapping mapping, HttpServletRequest request)
public static SharedFlowController ensureSharedFlow(HttpServletRequest request, HttpServletResponse response)
SharedFlowController
instance.
request
- the current HttpServletRequest.response
- the current HttpServletResponse
SharedFlowController
from the user session, or a newly-instantiated one
if none was in the session. Failing that, return null
.public static SharedFlowController ensureSharedFlow(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
SharedFlowController
instance.
request
- the current HttpServletRequest.response
- the current HttpServletResponseservletContext
- the current ServletContext
SharedFlowController
from the user session, or a newly-instantiated one
if none was in the session. Failing that, return null
.public static void setCurrentActionResolver(ActionResolver resolver, HttpServletRequest request)
PageFlowController
) in the user session.
resolver
- the ActionResolver to set as the current one in the user session.request
- the current HttpServletRequest.public static String getSharedFlowClassName(HttpServletRequest request, ServletContext servletContext)
public static String getSharedFlowClassNameForRelativeURI(String relativeURI, HttpServletRequest request, ServletContext servletContext)
public static FlowController getFlowController(Class fcClass, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
public static SharedFlowController getSharedFlow(FlowController pfc, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
public static boolean isSharedFlowModule(ModuleConfig mc)
public static FacesBackingBean getFacesBackingBean(ServletRequest request)
public static String inferModulePathFromClassName(String className)
public static boolean isMultipartHandlingEnabled(HttpServletRequest request)
public static PageflowConfig.MultipartHandler.Enum getMultipartHandlerType()
public static ServletContext getServletContext(HttpServletRequest request)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |