Servlet

• Servlet is an interface.
• When you use it inside a java class then it is known as Servlet class.
• The class which is executed by the Server (creation of object, execution of object, destroying of object done by the server) is known as LifeCycle Base   Class.
• Servlet is a Server Side Technology which is used to develop Dynamic Web Application/page.

Root of Servlet

Static : The static web page remains constant for every Request.
Dynamic : The dynamic web page changes itself as per the Request.
For developing the dynamic web pages,we use Servlet.

Let's take an example of Application for addition of two numbers :



In the above example, index page is static for each and every user.But after submission, resulting page is dynamic according to user's request and this dynamic page is developed by using Servlet.