Solved

•Servlet Callback method ??

Posted on 2004-08-15
3
966 Views
Last Modified: 2013-12-10
•why we say that the followings are Servlet Callback method ?
–doGet
–doPost
–Init
–Destroy

why we use the word "callback".

thanks
0
Comment
Question by:she1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 23

Expert Comment

by:rama_krishna580
ID: 11807028
Hi,

A callback method is a method intended to be passed as a parameter. The callee can then call the passed method asynchronously and with whatever parameters it deems appropriate. Callbacks are often used in event handling code.

R.K
0
 
LVL 7

Expert Comment

by:damonf
ID: 11825012
as RK says, a callback method is designed to be called asynchronously.  That is, if object A owns method callback(), and object A enlists object B to perform some work, object B may later call a.callback() with the result of the work.  Object A does not need to maintain a reference to B for this to happen.

doGet and doPost are callbacks because any HTTP client can call them any time.  Init() and destroy() are callbacks because the container can call them anytime if it wishes to start and stop the servlet.  Actually doGet and doPost are really called by the container as well (in reaction to the client's HTTP request).  But they still can be called any time.
0
 
LVL 1

Accepted Solution

by:
fschutte earned 30 total points
ID: 11907693
they are simply callback methods because they are invoked by the container (every container managed component has callback methods because that's the way to communicate with the container)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most of the developers using Tomcat find it easy to configure the datasource in Server.xml and use the JNDI name in the code to get the connection.  So the default connection pool using DBCP (or any other framework) is made available and the life go…
Upgrading Tomcat – There are a couple of methods to upgrade Tomcat is to use The Apache Installer is to download and unzip and run the services.bat remove|install Tomcat6 Because of the App that we are working with, we can only use Tomcat 6.…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question