wood burning stoves*
The moose likes Servlets and the fly likes Why dont we use GenericServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Why dont we use GenericServlet " Watch "Why dont we use GenericServlet " New topic

Why dont we use GenericServlet

abhay jain
Ranch Hand

Joined: Jun 03, 2011
Posts: 130
GenericServlet is an abstract class it can handle all types of protocols,but HttpServlet handle only Http specific protocols

then Why dont we use GenericServlet
Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

GenericServlet is a Abstract class. You need to implement all the unimplemented methods.

For Http protocols, these methods are implemented by the HttpServlet class and we simply extend it and use it in our servlet.

but nothing stops us from using GenericServlet abstract class. Infact we need to use GenericServletif we are going to use any protocol other than HTTP.

Ashwin Sridhar
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41129
Also see http://www.coderanch.com/how-to/java/ServletsFaq#overriding-service and http://www.coderanch.com/how-to/java/ServletsFaq#otherProtocols

Ping & DNS - my free Android networking tools app
abhay jain
Ranch Hand

Joined: Jun 03, 2011
Posts: 130
Thanks Ashwin Sridhar, Ulf Dittmer

I agree. Here's the link: http://aspose.com/file-tools
subject: Why dont we use GenericServlet
Similar Threads
Handling the non-HTTP protocol request
Usage of JSPs and Servlets in different technologies
about http actions in while using generic servlet
Web Server & Servlets