permaculture playing cards*
The moose likes Servlets and the fly likes in which interface or class the method service(request, response) is present? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "in which interface or class the method service(request, response) is present?" Watch "in which interface or class the method service(request, response) is present?" New topic
Author

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

Nagaraj Shivaklara
Ranch Hand

Joined: Dec 16, 2008
Posts: 77
Hi,

Please let me know in which interface or class method service(request,response) is present? i mean in generic servlet or httpservlet?


Thanks n Regards,
Nagaraj S K
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Check the API.


[My Blog]
All roads lead to JavaRanch
swapnel surade
Ranch Hand

Joined: Mar 05, 2009
Posts: 129

In GenericServlet there is service(req,res) method present
Nilesh Miskin
Ranch Hand

Joined: Jun 17, 2010
Posts: 44
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.


Nilesh Miskin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: in which interface or class the method service(request, response) is present?