|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value=METHOD) @Inherited @Documented public @interface After
Specifies that the annotated method should be run after the specified
LifecycleStage
(s). More than one LifecycleStage can be specified, in which case the
method will be run after each stage completes. If no LifecycleStage is specified then the
default is to execute the method after LifecycleStage.EventHandling
.
LifecycleStage.RequestInit
cannot be specified because there is no ActionBean
to run a method on before the ActionBean has been resolved!
The method may have any name, any access specifier (public, private etc.) and must take
no arguments. Methods may return values; if the value is a
Resolution
it will be used immediately to terminate
the request. Any other values returned will be ignored.
Examples:
// Runs only after the event handling method has been run @After public void doStuff() { ... } // Runs after binding and validation have completed @After(stages = LifecycleStage.BindingAndValidation) public void doPostValidationStuff() { ... } // Runs twice, once after each validation-related stage @After(stages = {LifecycleStage.BindingAndValidation, LifecycleStage.CustomValidation}) public void doMorePostValidationStuff() { ... }
Before
,
BeforeAfterMethodInterceptor
Optional Element Summary | |
---|---|
String[] |
on
Allows the method to be restricted to one or more events. |
LifecycleStage[] |
stages
One or more lifecycle stages after which the method should be called. |
public abstract LifecycleStage[] stages
public abstract String[] on
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |