jQuery in Action, 3rd edition
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 Building Microservices this week in the Design 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: 42958
Also see http://www.coderanch.com/how-to/java/ServletsFaq#overriding-service and http://www.coderanch.com/how-to/java/ServletsFaq#otherProtocols
abhay jain
Ranch Hand

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

I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Why dont we use GenericServlet
It's not a secret anymore!