What are Servlets?

What are Servlets?

All Java programmers probably know what Java applets are and how they differ from Java applications. After all applets were Java’s gateway into the Internet. Servlets are Java’s entry into the server side of the client-server paradigm.

Servlets are Java’s server-side counterpart of applets and are also known as “faceless applets.” Just as applets run in Web browsers, servlets run in Web servers. Unlike applets, servlets have no standard user interface. In JDK 1.2, Java has an extension package, javax.servlet that defines the Servlet API. The most common use for servlets is as a replacement for CGI scripts.

A servlet’s main purpose in life is to server up HTML to the client, most often through the HTTP protocol. Servlets are created, managed, and destroyed by the Web server that they run in. They are known only in the context of a Web server. Some of the popular Web servers that support servlets are Microsoft IIS, Netscape Enterprise, Apache server, and the Sun Web server.

Servlets help support thin clients. Computation-intensive functionality can be moved over to the server side and accessed via servlets instead of forcing the client to download the necessary classes to the client side.

See also  5 Tips for Working With an Onsite Interpreter

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist