aspose file tools*
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "Why dont we use GenericServlet " Watch "Why dont we use GenericServlet " New topic
Author

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
SCJP | SCWCD | OCA
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41865
    
  63
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