adspace
What is interceptor? And life cycle methods of interceptor?
Answer Posted / Alok Ranjan
In Struts, an Interceptor is a Java class that performs specific tasks before or after an Action is executed. It can be used for tasks such as authentication, logging, and input validation.nnThe life cycle methods of an Interceptor are:n- init() - Initialization method called when the interceptor stack is initialized.n- destroy() - Destruction method called when the interceptor stack is destroyed.n- intercept() - Method that performs the actual interception. It receives an ActionInvocation object, which allows it to call the Action's methods.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers