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

in which interface or class the method service(request, response) is present?

 
Nagaraj Shivaklara
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please let me know in which interface or class method service(request,response) is present? i mean in generic servlet or httpservlet?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the API.
 
swapnel surade
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In GenericServlet there is service(req,res) method present
 
Nilesh Miskin
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The service method & other servlet lifecycle methods come from the javax.servlet.Servlet interface. The javax.servlet.GenericServlet is the abstract class that implements Servlet interface. To write a generic servlet you only need to override the abstract service() method. However mostly we use javax.servlet.http.HttpServlet. Here you never override service() method. The default implementation of service() provided by this abstract class handles HTTP requests by dispatching them to the handler methods(doXXX() methods) for each HTTP request type. e.g.doGet() for a GET request.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic