Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1052
  • Last Modified:

•Servlet Callback method ??

•why we say that the followings are Servlet Callback method ?
–doGet
–doPost
–Init
–Destroy

why we use the word "callback".

thanks
0
she1
Asked:
she1
1 Solution
 
rama_krishna580Commented:
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
 
damonfCommented:
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
 
fschutteCommented:
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now