Servlet is a web technology, which is used to develop web application. It is used to process the HTTP request by the client. Servlet was first introduced by the Sun MicroSystems with released of  version 1.0 in 1997.
Now in 2013 its recent release is with version 3.1.
First Annotation concept introduced with the release of version 2.5

Previously CGI ( Common Gateway Interface ) was used for request processing and to generate dynamic context. But it has many limitations like platform dependency which is overcome with the introduction of servlet which is simply a java class and solves the platform dependency problem. 

Servlet is capable of understanding, handling and processing the different ' requests ' requested by the client where client is nothing but the browsers. So servlet forms the bridge between the client and server so that communication can take place effectively through HTTP protocol. Due to request handling and processing Servlet stands at Controller Layer.


Complete Request Processing

A request is done by the client to the server where servlet is running which handles the request, get processed, interact with the database if required and finally stores the requested information in the response object which is displayed in the JSP.  

* To run and deploy Servlet we need a web container which is also called as the servlet container responsible for managing the life cycle of Servlet, mapping the requested URL to the particular servlet. 

   
( Diagram showing how request processed by Servlet and present the response to Browser )

Servlet API is provided by server vendors. Java Vendor has implemented some of the interfaces required and its sub-classes are written by the server vendors in the servlet API. So finally the server we are using must have their own implemented servlet-api. 

How do we call a Java class as Servlet class?

A simple java class extending the javax.servlet.http.HttpServlet class which has parametrized service method with HttpServletRequest and HttpServletRespons as the parameters.

To know about Servlet Life Cycle   click here . 

0 comments:

Post a Comment

Ads 468x60px

.

Ads

.

Featured Posts

Popular Posts

Like Us On FaceBook

Total Pageviews

Online Members

Live Traffic