Advanced Java and Web Technologies for JNTUK
Blog providing beginner tutorials on different web technologies like HTML, CSS, Javascript, PHP, MYSQL, XML, Java Beans, Servlets, JSP and AJAX

02/10/2016 Categories: Servlets. No Comments on Introduction to Servlets

Servlets is a Java based technology for server side processing. Other languages or technologies for server side processing are PHP, JSP, node.js, Perl etc.

 

Definition of a Servlet

 

A servlet is a special Java class which is dynamically loaded on the server and used to generate dynamic content.

 

Following are the general steps that happen when a client requests a servlet:

  1. Client sends a HTTP request from web browser containing a URL with servlet.
  2. Web server receives the request and forwards the request to application server.
  3. Using information available in xml (deployment descriptor) the servlet container loads the object appropriate servlet class.
  4. If required, the servlet retrieves data from database, processes it and sends the response back to web server.
  5. Web server forwards the response back to the client who sent the request.

 

Above steps can be illustrated as follows:

servlet-architecture

 

Features of Servlets

 

Following are the features of servlets:

  • High-level
  • Component-based
  • Platform independent
  • Server independent
  • High performance (overcomes CGI limitation)
  • Highly scalable

 

CGI vs. Servlets

 

Following are the differences between Common Gateway Interface (CGI) and Servlets:

cgi-vs-servlets

 

Servlet Container

 

Servlet container or servlet engine is a set of objects that provides the runtime environment for servlets. Servlet container manages the life cycle of a servlet.

 

Following functionality is provided by the servlet container:

  • Network services
  • Decoding and encoding of MIME based messages
  • Servlet life cycle management
  • Resource management
  • Security
  • Session management
Suryateja Pericherla

Suryateja Pericherla

Hello, I am Suryateja Pericherla working as an Asst. Professor in CSE department at Vishnu Institute of Technology. I write articles to share my knowledge and make people knowledgeable regarding certain topics.
Suryateja Pericherla

Latest posts by Suryateja Pericherla (see all)

Note: Do you have a question on this article or have a suggestion to make this article better? You can ask or suggest us by filling in the below form. After commenting, your comment will be held for moderation and will be published in 24-48 hrs.

Leave a Reply

Scroll Up
Thank you for visiting startertutorials.com! If you like this website do share with your friends by clicking on the social icons available on the left hand side.

As the domain name is quite large to remember, use this short domain to visit this site. Short domain: stuts.me