Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple question on service

 
Veena Pointi
Ranch Hand
Posts: 442
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In ServletAPI it is given for doGet,doPost .......methods that they are called via service method???What does this mean?When exactly service method is called?When request is made for a particular servlet?I am sorry if I have confused.
Thanks
Veena
 
Frank Carver
Sheriff
Posts: 6920
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The service method is called any time a HTTP request arrives at the server which is mapped to that servlet.
The servlet container decodes each request, creates HttPRequest and HttpResponse objects and calls service. The service method examines the request, and chooses the correct one of doGet, doPost, doHead etc. to call.
Does that make sense?
 
Veena Pointi
Ranch Hand
Posts: 442
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Frank.Actually super class's service method is called right?I mean the one in HttpServlet class?
Thanks again.
Veena.
 
Frank Carver
Sheriff
Posts: 6920
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general, yes.
All teh servlet container knows how to do is call the "service(HttpRequest, HttpResponse) method. By default, the one from HttpServlet is used, but if you override this method in your own servlet, that one will be called instead.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic