Do you know why Java became more popular language with in a short span of time? The very simple answer for this question is - Java is a very simple and efficient to develop web applications. This is indirectly because, Java is platform independent. The approach of "Byte code" has changed the entire world and it was a very innovative idea from the Sun team who lead by James Gausling.

Sun Microsystems had come up with a solution for CGI scripts with an ultra flexibility structure to develop complex web applications, which was the revolutionary process at that times. They named the technology name as "Servlet". Now I'm going to discuss about some basic features.

Servlets can be implemented on any transactional layer protocols like HTTP, FTP, SMTP, etc though HTTP is most commonly used protocol for Servlets.

I hope you know HTTP protocol and how it works? If you're new to HTTP protocol, please read my old post about HTTP Protocol.

What is a Servlet?


A Servlet is a server side component, which reacts for each client request. Programmatically a Servlet is a Java class which directly or indirectly a implementation class of javax.servlet.Servlet interface.

Sun Microsystems had released the open source Servlet technology specification, by which any web container vendor has to implement the runtime environment. Web container is a terminology for a HTTP server. The popular web containers are Apache Tomcat, Sun One server, Oracle Weblogic (It was an initially owned by Bea and Oracle took over Bea later), IBM JBoss etc.

How it works?


Servlets technology is completely Client and Server model. Since most popular protocol that people use to implement Servlets is HTTP, Servlets will run on web server to serve the web client (Typically a web browser) request. As I said earlier, each Servlet is an implementation class which will have some predefined methods like service, doGet, doPost etc. One of the method would be invoked when a request comes for a respective Servlet.

In my future posts, I'll explain about Servlet programming with some sample codes.