I read the sentence “jsp page overrides two container callbacks using jspInit() and jspDestroy()” I like to know what are callbacks
Can anybody elaborate on this?
Thanks..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You might find this question and answer useful for the general concept of a callback: What is a callback function?
This is a typical way to implement a framework (such as JSP for example). The framework manages a complex environment for you such as web server (a container in JSP speak). In order to tell the framework/container what to do do for you at various points you implement some callback functions which the framework calls at the appropriate time. In your example container manages the JSP for you. The
jspInit()method is invoked when the JSP page is initialized so you could put any setup code for your in there. ThejspDestroy()method is invoked when the JSP page is about to be destroyed, so you could put any tear down code for your JSP in there.