Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SCWCD exam study kit: Note on page 35 and and HelloWorldServlet on page 8 don't match

 
Urs Wiss
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
On page 35 the author mentions, that if you override the service method in
your servlet class, you will lose the functionality provided by HttpServlet,
and the doXXX() methods will therefore not be called automatically and you
have to call it yourself. But the HelloWorldServlet on page 8, which overrides
the service method, doesn't call the doGet() method. Calling the doXXX()
method is therefore not always necessary?
Appreciate any feedback,
Urs
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3712
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Calling the doXXX methods is definitely not necessary. But if you have coded those methods, which you usually do, and if you have overridden the service() method, then you will need to call the doXXX methods yourself from the service method.
The HelloWorldServlet does not have doXXX methods so there is no need to call them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic