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 . 

Related Posts:

  • Hidden Form field in Session handling One of the major disadvantage with the URL Rewriting is that passing session data with the URL makes visible to every one who are requesting for the resource. To over come this problem the concept of hidden form field is i… Read More
  • Cookies in Session handling Cookies is the concept of storing the client's information in the client machine itself but in the form of a file called as Cookies. So it contains all the information sent by the Web server with the response header. previ… Read More
  • URL Re-writing in Session Handling URL Re-writing is a technique by which session data can be handled within the server side only.Client is not responsible for keeping any information regarding session. In this process at every request the required session da… Read More
  • include() in servlet include() is a method defined in the RequestDispatcher interface with ServletRequest and ServletResponse as a parameter. It is same as forward with slight difference of storing the content of both source and target resourc… Read More
  • Handling Session in Servlet Handling session defines how session should be managed internally. Session is meant for keeping track of user's information which is required further for the next proceeding requests. Scope of a session is alive from its cr… Read More

0 comments:

Post a Comment

Ads 468x60px

.

Ads

.

Featured Posts

Popular Posts

Like Us On FaceBook

Total Pageviews

201976

Online Members

Live Traffic