Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

can anybody explain what is callback method?

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, everyone,

In HFSJ ch13 Q1:

Which are true about filters?

B. The destroy methos is always a container callback method.
C. The doFilter method is always a container callback method.

Answer B is right.

Can anybody explain this answer and what is callback method?

Thank you so very much.

Anna
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The term callback method means the same as in normal conversations.

If I meet someone and want them to contact me, I will give them
my phone number. This is known as my callback number.

Similarly, when a container starts up a filter says to the container
that it is a filter and that it can be contacted by calling the
doFilter method. Since every filter has a doFilter method [required
by the interface] doFilter is called a callback method.

You could say that doGet is a callback method for servlets.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another way of thinking of it is simply that callback methods are methods you never call in your code. They are the methods only the container should ever call.
 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In HFSJ ch13 Q1:

Which are true about filters?

B. The destroy methos is always a container callback method.
C. The doFilter method is always a container callback method.

Answer B is right.

As per Marc Peabody,

Another way of thinking of it is simply that callback methods are methods you never call in your code. They are the methods only the container should ever call.

so, both B,C are correct as per Marcs statement.

Please give a complete explanation on the above question.
also, whtat is a inline method ?
 
He was expelled for perverse baking experiments. This tiny ad is a model student:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic