What is Servlet? Explain the position of servlets in web applications with suitable diagram.

 Java servlets are server-side program that runs inside a web server and handle client requests and return a dynamic response for each request. The dynamic response could be based on the user's input (e.g., search, online shopping, online transaction) with data retrieved from databases or other applications, or time-sensitive data (such as news and stock prices). It acts as a middle layer between requests coming from a Web browser or other HTTP client and databases or applications on the HTTP server (The web server). 

The following diagram shows the position of Servlets in a Web Application.


Servlets perform the following major tasks

Read the explicit data sent by the clients: This includes an HTML form on a Web page or it could also come from an applet.

Read the implicit HTTP request data sent by the clients: This includes cookies, media types and compression schemes the browser understands, and so forth.

Process the data and generate the results: This process may require talking to a database, invoking a Web service, or computing the response directly.

Send the explicit data to the clients: This document can be sent in a variety of formats, including text (HTML or XML), binary (GIF images), Excel, etc.

Send the implicit HTTP response to the clients: This includes telling the browsers or other clients what type of document is being returned (e.g., HTML), setting cookies and caching parameters, and other such tasks.

Comments

Popular posts from this blog

Suppose that a data warehouse for Big-University consists of the following four dimensions: student, course, semester, and instructor, and two measures count and avg_grade. When at the lowest conceptual level (e.g., for a given student, course, semester, and instructor combination), the avg_grade measure stores the actual course grade of the student. At higher conceptual levels, avg_grade stores the average grade for the given combination. a) Draw a snowflake schema diagram for the data warehouse. b) Starting with the base cuboid [student, course, semester, instructor], what specific OLAP operations (e.g., roll-up from semester to year) should one perform in order to list the average grade of CS courses for each BigUniversity student. c) If each dimension has five levels (including all), such as “student < major < status < university < all”, how many cuboids will this cube contain (including the base and apex cuboids)?

Pure Versus Partial EC

Short note on E-Government Architecture