public class DispatcherHelper
extends java.lang.Object
Constructor and Description |
---|
DispatcherHelper() |
Modifier and Type | Method and Description |
---|---|
static boolean |
applies(ValidationMethod info,
java.lang.String event)
Determines if the ValidationMethod annotation should be applied to the named
event.
|
static Resolution |
doBindingAndValidation(ExecutionContext ctx,
boolean validate)
Responsible for performing binding and validation.
|
static Resolution |
doCustomValidation(ExecutionContext ctx,
boolean alwaysInvokeValidate)
Responsible for coordinating the invocation of any custom validation logic exposed
by the ActionBean.
|
static void |
executeResolution(ExecutionContext ctx,
Resolution resolution)
Responsible for executing the Resolution returned by the request.
|
static void |
fillInValidationErrors(ExecutionContext ctx)
Makes sure that validation errors have all the necessary information to render
themselves properly, including the UrlBinding of the action bean and the field
value if it hasn't already been set.
|
static java.lang.reflect.Method[] |
findCustomValidationMethods(java.lang.Class<? extends ActionBean> type)
Finds and returns all methods in the ActionBean class and it's superclasses that
are marked with the ValidationMethod annotation and returns them ordered by
priority (and alphabetically within priorities).
|
static javax.servlet.jsp.PageContext |
getPageContext()
Used by the validation subsystem to access a page context that can be used to
create an expression evaluator for use in the expression validation code.
|
static Resolution |
handleValidationErrors(ExecutionContext ctx)
Responsible for checking to see if validation errors exist and if so for handling
them appropriately.
|
static Resolution |
invokeEventHandler(ExecutionContext ctx)
Responsible for invoking the event handler identified.
|
static void |
logValidationErrors(ActionBeanContext context)
Log validation errors at DEBUG to help during development.
|
static Resolution |
resolveActionBean(ExecutionContext ctx)
Responsible for resolving the ActionBean for this request and setting it on the
ExecutionContext.
|
static Resolution |
resolveHandler(ExecutionContext ctx)
Responsible for resolving the event name for this request and setting it on the
ActionBeanContext contained within the ExecutionContext.
|
static void |
setPageContext(javax.servlet.jsp.PageContext ctx)
Should be called prior to invoking validation related methods to provide the helper
with access to a PageContext object that can be used to manufacture expression
evaluator instances.
|
public static void setPageContext(javax.servlet.jsp.PageContext ctx)
ctx
- a page context object supplied by the containerpublic static javax.servlet.jsp.PageContext getPageContext()
public static Resolution resolveActionBean(ExecutionContext ctx) throws java.lang.Exception
ctx
- the ExecutionContext being used to process the current requestjava.lang.Exception
public static Resolution resolveHandler(ExecutionContext ctx) throws java.lang.Exception
ctx
- the ExecutionContext being used to process the current requestjava.lang.Exception
public static Resolution doBindingAndValidation(ExecutionContext ctx, boolean validate) throws java.lang.Exception
ctx
- the ExecutionContext being used to process the current requestjava.lang.Exception
public static Resolution doCustomValidation(ExecutionContext ctx, boolean alwaysInvokeValidate) throws java.lang.Exception
ctx
- the ExecutionContext being used to process the current requestjava.lang.Exception
public static boolean applies(ValidationMethod info, java.lang.String event)
Determines if the ValidationMethod annotation should be applied to the named event. True if the list of events to apply the validation to is empty, or it contains the event name, or it contains event names starting with "!" but not the event name. Some examples to illustrate the point
info
- the ValidationMethod being examinedevent
- the event being processedpublic static java.lang.reflect.Method[] findCustomValidationMethods(java.lang.Class<? extends ActionBean> type) throws java.lang.Exception
type
- a Class representing an ActionBeanjava.lang.Exception
public static Resolution handleValidationErrors(ExecutionContext ctx) throws java.lang.Exception
ctx
- the ExecutionContext being used to process the current requestjava.lang.Exception
public static void fillInValidationErrors(ExecutionContext ctx)
ctx
- the ExecutionContext being used to process the current requestpublic static Resolution invokeEventHandler(ExecutionContext ctx) throws java.lang.Exception
ctx
- the ExecutionContext being used to process the current request
type conversion should occurjava.lang.Exception
public static void executeResolution(ExecutionContext ctx, Resolution resolution) throws java.lang.Exception
LifecycleStage.ResolutionExecution
, sets the resolution
on the execution context and then invokes the interceptor chain to execute the
Resolution.ctx
- the current execution context representing the requestresolution
- the resolution to be executed unless another is substituted by an
interceptor before calling ctx.proceed()java.lang.Exception
public static final void logValidationErrors(ActionBeanContext context)
? Copyright 2005-2006, Stripes Development Team.