This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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. Zafer
Ajan [This message has been edited by Ajan Balakrishnan (edited February 12, 2001).]
Joined: Nov 03, 2000
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.
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.
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