|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.stripes.controller.DispatcherHelper
public class DispatcherHelper
Helper class that contains much of the logic used when dispatching requests in Stripes. Used primarily by the DispatcherSerlvet, but also by the UseActionBean tag.
Constructor Summary | |
---|---|
DispatcherHelper()
|
Method Summary | |
---|---|
static boolean |
applies(ValidationMethod info,
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 Method[] |
findCustomValidationMethods(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 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(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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DispatcherHelper()
Method Detail |
---|
public static void setPageContext(PageContext ctx)
ctx
- a page context object supplied by the containerpublic static PageContext getPageContext()
public static Resolution resolveActionBean(ExecutionContext ctx) throws Exception
ctx
- the ExecutionContext being used to process the current request
Exception
public static Resolution resolveHandler(ExecutionContext ctx) throws Exception
ctx
- the ExecutionContext being used to process the current request
Exception
public static Resolution doBindingAndValidation(ExecutionContext ctx, boolean validate) throws Exception
ctx
- the ExecutionContext being used to process the current request
Exception
public static Resolution doCustomValidation(ExecutionContext ctx, boolean alwaysInvokeValidate) throws Exception
ctx
- the ExecutionContext being used to process the current request
Exception
public static boolean applies(ValidationMethod info, 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 processed
public static Method[] findCustomValidationMethods(Class<? extends ActionBean> type) throws Exception
type
- a Class representing an ActionBean
Exception
public static Resolution handleValidationErrors(ExecutionContext ctx) throws Exception
ctx
- the ExecutionContext being used to process the current request
Exception
public static void fillInValidationErrors(ExecutionContext ctx)
ctx
- the ExecutionContext being used to process the current requestpublic static Resolution invokeEventHandler(ExecutionContext ctx) throws Exception
ctx
- the ExecutionContext being used to process the current request
type conversion should occur
Exception
public static void executeResolution(ExecutionContext ctx, Resolution resolution) throws 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()
Exception
public static final void logValidationErrors(ActionBeanContext context)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |