| 1. |
What Is The Purpose Of @beforeresult Annotation? |
|
Answer» The @BeforeResult annotation MARKS a ACTION method that needs to be executed before the result. Return value is ignored. PUBLIC class EMPLOYEE extends ActionSupport{ @BeforeResult public void isValid() throws ValidationException { // validate model object, throw EXCEPTION if failed } public String execute() { // perform action return SUCCESS; } } The @BeforeResult annotation marks a action method that needs to be executed before the result. Return value is ignored. public class Employee extends ActionSupport{ @BeforeResult public void isValid() throws ValidationException { // validate model object, throw exception if failed } public String execute() { // perform action return SUCCESS; } } |
|