A Java application in a Web or application server that provides server-side processing such as e-commerce and database search. Servlets are designed to handle HTTP requests (get, post, etc.) and are the Java replacement for a variety of methods, including CGI scripts, Active Server Pages (ASPs) and proprietary C/C++ plug-ins for specific Web servers (ISAPI, NSAPI).
Because they are written in Java, servlets are portable between servers and operating systems. The servlet programming interface (Java Servlet API) is a standard part of the Java EE platform. If a Web server does not run servlets natively, a third-party servlet plug-in can be installed to add the runtime support. See servlet container
, application server
, Java EE
and CGI script
Servlets Run in the Server
Servlets, as well as JavaServer Pages (JSPs), are server-side applications. The Web server or application server must support servlet processing, which became available as part of the Java 2 platform.