Java Servlet
Java Servlets are the main entries for developing Java Web applications. But what is a servlet exactly. A short introduction created on several sources on the Internet [1].
Introduction
What is a Java servlet? Essentially, a servlet is a Java applet that's designed to run on a server, rather than on a web browser. [2] They're commonly use to extend the capabilities of a server.
For instance, a servlet might act as an interface to run a database query. It might hold and manage additional information alongside a stateless HTTP protocol. Or it might convert input from an HTML form into a format more useful to the server. In their function, servlets can be thought of as the Java counterparts to other technologies like PHP and ASP.NET.
Request-Response
The main model for a servlet is request-response. Applications or users interact with the servlet by sending a request, perhaps for a certain piece of data. The servlet then takes that request and translates it into a series of operations on the server itself. The results from the server are translated back into a response that the user can readily understand. In this sense then, a servlet is just a translator between the user interface and the server behind it. Technically speaking, an application is only a servlet if it implements the Java Servlet API, which defines the overall structure for the servlet family of classes.
The main model for a servlet is request-response. Applications or users interact with the servlet by sending a request, perhaps for a certain piece of data. The servlet then takes that request and translates it into a series of operations on the server itself. The results from the server are translated back into a response that the user can readily understand. In this sense then, a servlet is just a translator between the user interface and the server behind it. Technically speaking, an application is only a servlet if it implements the Java Servlet API, which defines the overall structure for the servlet family of classes.