Logo F2FInterview

Servlet Interview Questions

Q   |   QA
‹‹ previous1234567

A Servlet can be created by extending the httpServlet or GenericServlet classes.

Servlets are server side components that provide a powerful mechanism for developing server side programs. Servlets provide component-based, platform-independent methods for building Web-based applications, without the performance limitations of CGI programs.

Servlet interface contains three methods known as life-cycle methods.
Init , service and destroy.
First the servlet is constructed, then initialized with the init() method. Any request from client are handled initially by the service() method before delegating to the doXxx() methods in the case of HttpServlet. The servlet is removed from service, destroyed with the destroy() method, then garbaged collected and finalized.

Cookies
SSL sessions
URL- rewriting

A GenericServlet has a service() method to handle the requests. HttpServlet extends GenericServlet and adds support for doGet (), doPost () methods doPut (), doOptions (), doDelete (), doTrace () methods.

‹‹ previous1234567

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: