File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Generic Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Generic Servlet" Watch "Generic Servlet" New topic

Generic Servlet

mohamed zafer
Ranch Hand

Joined: Nov 03, 2000
Posts: 62
Hello Friends,
I have used HTTPServlet, and I want to know the use of Generic servlets.
I have the following Questions.
Under what circumtances are Generic servlet used and How are they used.
Can Generic Servlet be used instead of HTTPServlet.
Any example code will be of great help to me.
Ajan Balakrishnan
Ranch Hand

Joined: Jan 04, 2001
Posts: 71
Hope these post helps

[This message has been edited by Ajan Balakrishnan (edited February 12, 2001).]
mohamed zafer
Ranch Hand

Joined: Nov 03, 2000
Posts: 62
Hai Ajan,
Thank you for your response. The links provided by give only the definition of the Generic servlet, but it would be better if you help me know how to use it. Consider suppose I am not using HTTP but I do want to use servlet, in that case how can I extend Generic Servlet.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

I dont think GenericServlet is implemented much. It is much more common to use sockets for non-http connection.
This is what the API says although I realize it is little help:
To write a generic servlet, you need only override the abstract service method.

Visit my download page

Joined: Jan 05, 2001
Posts: 7
http servlet mainly deals with http protocol implementation and hence when u r using http use this one
generic is for all protocols it does not have specific methods for http like doGet() and doPost() doHead() etc
I agree. Here's the link:
subject: Generic Servlet
It's not a secret anymore!