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
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

Categories: Servlets. 1 Comment on Introduction to Servlets
3
(1)

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

 


Subscribe to our monthly newsletter. Get notified about latest articles, offers and contests.


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

How useful was this post?

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Suryateja Pericherla

Suryateja Pericherla, at present is a Research Scholar (full-time Ph.D.) in the Dept. of Computer Science & Systems Engineering at Andhra University, Visakhapatnam. Previously worked as an Associate Professor in the Dept. of CSE at Vishnu Institute of Technology, India.

He has 11+ years of teaching experience and is an individual researcher whose research interests are Cloud Computing, Internet of Things, Computer Security, Network Security and Blockchain.

He is a member of professional societies like IEEE, ACM, CSI and ISCA. He published several research papers which are indexed by SCIE, WoS, Scopus, Springer and others.

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.

1 Comment

You can follow any responses to this entry through the RSS 2.0 feed.

Very useful and interesting. Thankyou for sharing this Great article

Leave a Reply

Your email address will not be published. Required fields are marked *