
Introduction to Servlets, JSP, and Servlet Engines
What are Servlets?
Servlets are the Java Technologies’ answer to CGI programming. They are programs that run on the server-side and generate dynamic content. Why would one prefer to use Servlets over traditional CGI programming?
- Efficiency – Using CGI programming, each time an HTTP request is received a new process is started, which can result in poor performance and scalability issues. Using Servlets, the Java VM is always running, therefore, starting a Servlet creates a Java thread as opposed to a system process.
- Power – Servlets allow you power unknown by traditional CGI. They allow you to do things that would either be very difficult or otherwise impossible because they have access to the entire family of Java APIs. Servlets easily share data and maintain the information, making session tracking and other chores a breeze.
- Security – Servlets can be run by the Servlet engine in a restrictive sandbox, similar to a web browser’s sandbox for applets. This helps protect against malicious Servlets.
- Cost– There are plenty of “free” or low-cost web servers available for either personal use or low volume traffic. If you have a web server, chances are you can add Servlet technology quickly, easily, and best of all, cheaply.
- Portability – The Servlet API takes advantage of the Java platform. It is a fairly simple API that is supported by nearly all web servers so that Servlets may be moved from platform to platform, usually without any modification whatsoever.
A Servlet is a Java class and thus needs to be executed by the Java VM, called a Servlet engine. Servlets are loaded by the engine when they are called and remain running until the servlet is explicitly unloaded or the engine is shut down.
![How to Install Android Studio on Linux [4 Method]](/how-to-install-android-studio-on-linux-4-method/Android-Studio.jpg)


