How can you develop a servlet?
What are different ways to develop servlets?
Every servlet is a java class.There are 3 ways to develop a servlet based on servlet-API.
1.Take a public java class implementing javax.servlet. servlet interface & provide implementation for all the 5 methods of that interface.
2. Take a public java class extending from javax.servlet. Generic servlet &provide implementation for abstract method called service(servlet request, servlet response) method.
3. Take a public java class extending from javax.servlet.http servlet &override either one of the 7 doxxx() methods (or) one of the two service ()methods.
No comments:
Post a Comment