Java Servlet
Servlets are the Java programs that runs on the Java-enabled web server or application server. They are used to handle the request obtained from the web server, process the request, produce the response, then send response back to the web server.
Properties of Servlets :
- Servlets work on the server-side.
- Servlets capable of handling complex request obtained from web server.
Execution of Servlets
- The
clients
send therequest
to theweb server
. - The
web server receives
the request. - The
web server passes
the request to the correspondingservlet
. - The
servlet processes the request
andgenerate the response
in the form of output. - The
servlet send the response
back to theweb server
. The
web server
sends theresponse
back to theclient
and the client browser displays it on the screen.
Server-side extensions
- Java Servlet is one of the component APIs of Java Platform Enterprise Edition which sets standards for creating dynamic Web applications in Java.
- Common Gateway Interface(CGI) scripts
- Hypertext Preprocessor (PHP)
Java Servlets are more acceptable since they solve the limitations of CGI such as low performance and low degree scalability.
CGI
CGI is actually an external application which is responsible for processing client requests and generating dynamic content