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


Please Help Members By Posting Answers For Below Questions

How is declarative handling of exceptions done in struts ?

1010


What is the difference between filters and interceptors ?

1316


What do you know about validation plugin ?

1031


What are the contents on web.xml in struts application ?

1072


What is action chaining ?

1168