What is interceptor? And life cycle methods of interceptor?



What is interceptor? And life cycle methods of interceptor?..

Answer / 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

More Struts Interview Questions

Describe the two types of formbeans.

1 Answers  


what is project architecture?give brief explanation about project architecture?

3 Answers   CTS, Etisalat, IBM, Infinite Computer Solutions, Mphasis,


How struts control data flow?

1 Answers  


what is the disadvantage of struts frame work?

11 Answers  


Can i use constructor in Action Class?If yes how?

8 Answers  


What is the default suffix for Struts2 action URI and how can we change it?

1 Answers  


Explain the life cycle of a request in struct2 application?

1 Answers  


how many methods are there in RequestPrccesor class?

2 Answers   Infosys,


What is the use of web xml in struts2?

1 Answers  


What are the important methods of actionform?

1 Answers  


Explain about struts relation to html tags?

1 Answers  


Explain about the validation steps which have to be carried during validation of client-side address?

1 Answers  


Categories