Home Videos Exercises MCQ Q&A Quiz E-Store Services Blog Sign in Appointment Payment

Introduction of Servlet

Servlet is a technology which is used to create a web application.


Continue to Servlet Introduction

Servlet is a technology which is used to create a web application.
initial release December 1996.
stable release 31 May 2022.


What is servlet?

  • Servlet is a technology which is used to create a web application.
  • Servlet is an API that provides many interfaces and classes including documentation.
  • Servlet is an interface that must be implemented for creating any servlet.
  • Servlet is a class that extends the capabilities of the servers and responds to the incomming requests.
  • It can respond to any requests.

What is a web application

A web application is an application accessible from the web. A web application is composed of web components like servlet, jsp, filter etc.


CGI

CGI technology enables the web server to call an external program and pass HTTP request information to the external program to process the request.


Disadvantages of CGI

  • If the number of clients increases, it takes more time for sending the response.
  • Foreach request, it starts a process, and the web server is limited to start processes.
  • It uses platform dependent language like c, c++, perl.

Advantages of CGI

  • Better performance- because it creats a thread for each request, not process
  • Portability- because it uses java lanugage
  • Robust- JVM manages servlet, so we don't need to worry about the memory leak, garbage collection etc
  • Secure- because it uses java language

Servlet container performs many operations that are given below

  • life cycle management
  • multithreaded support
  • object pooling
  • security etc