Can you explain why servlets extend HttpServlet?

Can you explain why servlets extend HttpServlet?

- Most of the web applications uses HTTP protocol. The user requests need to be received and processed through the HTTP protocol.

- Hence, the servlets should extend HttpServlet and override the doGet() and / or doPost() methods, depending on the data that is sent by GET or by POST.

- The HttpServlet simplifies the handling of the HTTP protocol but its not a compulsion to extend the servlet class must extend the abstract HttpServlet class.

- The GenericServlet class can be extended to make the servlet protocol independent.
What is Servlet Filter and how does it work?
Filters are powerful tools in servlet environment. Filters add certain functionality to the servlets apart from processing request and response paradigm of servlet processing...
Explain the use of logic:iterate tag in struts application
The tag is utilized for repeating the nested body content over a collection. Every element / object in a specified collection...
Difference between DataInputStream and BufferedReader
The differences are: The DataInputStream works with the binary data, while the BufferedReader work with character data...
Post your comment