Skip to main content

Web Terminology

Web Terminology

Servlet TerminologyDescription
Website: static vs dynamicIt is a collection of related web pages that may contain text, images, audio and video.
HTTPIt is the data communication protocol used to establish communication between client and server.
HTTP RequestsIt is the request send by the computer to a web server that contains all sorts of potentially interesting information.
Get vs PostIt gives the difference between GET and POST request.
ContainerIt is used in java for dynamically generating the web pages on the server side.
Server: Web vs ApplicationIt is used to manage the network resources and for running the program or software that provides services.
Content TypeIt is HTTP header that provides the description about what are you sending to the browser.

Website

Website is a collection of related web pages that may contain text, images, audio and video. The first page of a website is called home page. Each website has specific internet address (URL) that you need to enter in your browser to access a website.

Website is hosted on one or more servers and can be accessed by visiting its homepage using a computer network. A website is managed by its owner that can be an individual, company or an organization.

Servlet Website1

A website can be of two types:

  • Static Website
  • Dynamic Website

Static website

Static website is the basic type of website that is easy to create. You don't need the knowledge of web programming and database design to create a static website. Its web pages are coded in HTML.

The codes are fixed for each page so the information contained in the page does not change and it looks like a printed page.

Servlet Website2

Dynamic website

Dynamic website is a collection of dynamic web pages whose content changes dynamically. It accesses content from a database or Content Management System (CMS). Therefore, when you alter or update the content of the database, the content of the website is also altered or updated.

Dynamic website uses client-side scripting or server-side scripting, or both to generate dynamic content.

Client side scripting generates content at the client computer on the basis of user input. The web browser downloads the web page from the server and processes the code within the page to render information to the user.

In server side scripting, the software runs on the server and processing is completed in the server then plain pages are sent to the user.

Servlet Website3

Static vs Dynamic website

Static WebsiteDynamic Website
Prebuilt content is same every time the page is loaded.Content is generated quickly and changes regularly.
It uses the HTML code for developing a website.It uses the server side languages such as PHP,SERVLET, JSP, and ASP.NET etc. for developing a website.
It sends exactly the same response for every request.It may generate different HTML for each of the request.
The content is only changed when someone publishes and updates the file (sends it to the web server).The page contains "server-side" code which allows the server to generate the unique content when the page is loaded.
Flexibility is the main advantage of static website.Content Management System (CMS) is the main advantage of dynamic website.

HTTP (Hyper Text Transfer Protocol)

The Hypertext Transfer Protocol (HTTP) is application-level protocol for collaborative, distributed, hypermedia information systems. It is the data communication protocol used to establish communication between client and server.

HTTP is TCP/IP based communication protocol, which is used to deliver the data like image files, query results, HTML files etc on the World Wide Web (WWW) with the default port is TCP 80. It provides the standardized way for computers to communicate with each other.

Servlet HTTP4

The Basic Characteristics of HTTP (Hyper Text Transfer Protocol):

  • It is the protocol that allows web servers and browsers to exchange data over the web.
  • It is a request response protocol.
  • It uses the reliable TCP connections by default on TCP port 80.
  • It is stateless means each request is considered as the new request. In other words, server doesn't recognize the user by default.

The Basic Features of HTTP (Hyper Text Transfer Protocol):

There are three fundamental features that make the HTTP a simple and powerful protocol used for communication:

  • HTTP is media independent: It specifies that any type of media content can be sent by HTTP as long as both the server and the client can handle the data content.
  • HTTP is connectionless: It is a connectionless approach in which HTTP client i.e., a browser initiates the HTTP request and after the request is sent the client disconnects from server and waits for the response.
  • HTTP is stateless: The client and server are aware of each other during a current request only. Afterwards, both of them forget each other. Due to the stateless nature of protocol, neither the client nor the server can retain the information about different request across the web pages.

The Basic Architecture of HTTP (Hyper Text Transfer Protocol):

The below diagram represents the basic architecture of web application and depicts where HTTP stands:

Servlet HTTP5

HTTP is request/response protocol which is based on client/server based architecture. In this protocol, web browser, search engines, etc. behave as HTTP clients and the Web server like Servlet behaves as a server

HTTP Requests

The request sent by the computer to a web server, contains all sorts of potentially interesting information; it is known as HTTP requests.

The HTTP client sends the request to the server in the form of request message which includes following information:

  • The Request-line
  • The analysis of source IP address, proxy and port
  • The analysis of destination IP address, protocol, port and host
  • The Requested URI (Uniform Resource Identifier)
  • The Request method and Content
  • The User-Agent header
  • The Connection control header
  • The Cache control header
HTTP Requests

The HTTP request method indicates the method to be performed on the resource identified by the Requested URI (Uniform Resource Identifier). This method is case-sensitive and should be used in uppercase.

The HTTP request methods are:

HTTP RequestDescription
GETAsks to get the resource at the requested URL.
POSTAsks the server to accept the body info attached. It is like GET request with extra info sent with the request.
HEADAsks for only the header part of whatever a GET would return. Just like GET but with no body.
TRACEAsks for the loopback of the request message, for testing or troubleshooting.
PUTSays to put the enclosed info (the body) at the requested URL.
DELETESays to delete the resource at the requested URL.
OPTIONSAsks for a list of the HTTP methods to which the thing at the request URL can respond

Get vs. Post

There are many differences between the Get and Post request. Let's see these differences:

GETPOST
1) In case of Get request, only limited amount of data can be sent because data is sent in header.In case of post request, large amount of data can be sent because data is sent in body.
2) Get request is not secured because data is exposed in URL bar.Post request is secured because data is not exposed in URL bar.
3) Get request can be bookmarked.Post request cannot be bookmarked.
4) Get request is idempotent . It means second request will be ignored until response of first request is deliveredPost request is non-idempotent.
5) Get request is more efficient and used more than Post.Post request is less efficient and used less than get.

Get vs. Post

GET and POST

Two common methods for the request-response between a server and client are:

  • GET- It requests the data from a specified resource
  • POST- It submits the processed data to a specified resource

Anatomy of Get Request

The query string (name/value pairs) is sent inside the URL of a GET request:

  1. GET/RegisterDao.jsp?name1=value1&name2=value2  

As we know that data is sent in request header in case of get request. It is the default request type. Let's see what information is sent to the server.

Servlet Request6

Some other features of GET requests are:

  • It remains in the browser history
  • It can be bookmarked
  • It can be cached
  • It have length restrictions
  • It should never be used when dealing with sensitive data
  • It should only be used for retrieving the data

Anatomy of Post Request

The query string (name/value pairs) is sent in HTTP message body for a POST request:

  1. POST/RegisterDao.jsp HTTP/1.1  
  2. Host: www. javatpoint.com  
  3. name1=value1&name2=value2  

As we know, in case of post request original data is sent in message body. Let's see how information is passed to the server in case of post request.

Servlet Request7

Some other features of POST requests are:

  • This requests cannot be bookmarked
  • This requests have no restrictions on length of data
  • This requests are never cached
  • This requests do not retain in the browser history

Servlet Container

It provides the runtime environment for JavaEE (j2ee) applications. The client/user can request only a static WebPages from the server. If the user wants to read the web pages as per input then the servlet container is used in java.

The servlet container is the part of web server which can be run in a separate process. We can classify the servlet container states in three types:

Servlet Container1

Servlet Container States

The servlet container is the part of web server which can be run in a separate process. We can classify the servlet container states in three types:

  • Standalone: It is typical Java-based servers in which the servlet container and the web servers are the integral part of a single program. For example:- Tomcat running by itself
  • In-process: It is separated from the web server, because a different program runs within the address space of the main server as a plug-in. For example:- Tomcat running inside the JBoss.
  • Out-of-process: The web server and servlet container are different programs which are run in a different process. For performing the communications between them, web server uses the plug-in provided by the servlet container.

The Servlet Container performs many operations that are given below:

  • Life Cycle Management
  • Multithreaded support
  • Object Pooling
  • Security etc.

Server: Web vs. Application

Server is a device or a computer program that accepts and responds to the request made by other program, known as client. It is used to manage the network resources and for running the program or software that provides services.

There are two types of servers:

  1. Web Server
  2. Application Server

Web Server

Web server contains only web or servlet container. It can be used for servlet, jsp, struts, jsf etc. It can't be used for EJB.

It is a computer where the web content can be stored. In general web server can be used to host the web sites but there also used some other web servers also such as FTP, email, storage, gaming etc.

Examples of Web Servers are: Apache Tomcat and Resin.


Web Server Working

It can respond to the client request in either of the following two possible ways:

  • Generating response by using the script and communicating with database.
  • Sending file to the client associated with the requested URL.

The block diagram representation of Web Server is shown below:

Web Server1

Important points

  • If the requested web page at the client side is not found, then web server will sends the HTTP response: Error 404 Not found.
  • When the web server searching the requested page if requested page is found then it will send to the client with an HTTP response.
  • If the client requests some other resources then web server will contact to application server and data is store for constructing the HTTP response.

Application Server

Application server contains Web and EJB containers. It can be used for servlet, jsp, struts, jsf, ejb etc. It is a component based product that lies in the middle-tier of a server centric architecture.

It provides the middleware services for state maintenance and security, along with persistence and data access. It is a type of server designed to install, operate and host associated services and applications for the IT services, end users and organizations.

The block diagram representation of Application Server is shown below:

Web Server2

The Example of Application Servers are:

  1. JBoss: Open-source server from JBoss community.
  2. Glassfish: Provided by Sun Microsystem. Now acquired by Oracle.
  3. Weblogic: Provided by Oracle. It more secured.
  4. Websphere: Provided by IBM.

Content Type

Content Type is also known as MIME (Multipurpose internet Mail Extension)Type. It is a HTTP header that provides the description about what are you sending to the browser.

MIME is an internet standard that is used for extending the limited capabilities of email by allowing the insertion of sounds, images and text in a message.

The features provided by MIME to the email services are as given below:

  • It supports the non-ASCII characters
  • It supports the multiple attachments in a single message
  • It supports the attachment which contains executable audio, images and video files etc.
  • It supports the unlimited message length.
Content Type

List of Content Types

There are many content types. The commonly used content types are given below:

  • text/html
  • text/plain
  • application/msword
  • application/vnd.ms-excel
  • application/jar
  • application/pdf
  • application/octet-stream
  • application/x-zip
  • images/jpeg
  • images/png
  • images/gif
  • audio/mp3
  • video/mp4
  • video/quicktime etc.
Anurag Rana

Comments

Popular posts from this blog

JAVA Scrollbar, MenuItem and Menu, PopupMenu

ava AWT Scrollbar The  object  of Scrollbar class is used to add horizontal and vertical scrollbar. Scrollbar is a  GUI  component allows us to see invisible number of rows and columns. AWT Scrollbar class declaration public   class  Scrollbar  extends  Component  implements  Adjustable, Accessible   Java AWT Scrollbar Example import  java.awt.*;   class  ScrollbarExample{   ScrollbarExample(){               Frame f=  new  Frame( "Scrollbar Example" );               Scrollbar s= new  Scrollbar();               s.setBounds( 100 , 100 ,  50 , 100 );               f.add(s);               f.setSize( 400 , 400 );               f.setLayout( null );               f.setVisible( true );   }   public   static   void  main(String args[]){           new  ScrollbarExample();   }   }   Output: Java AWT Scrollbar Example with AdjustmentListener import  java.awt.*;   import  java.awt.event.*;   class  ScrollbarExample{        ScrollbarExample(){               Frame f=  new  Frame( "Scro

Difference between net platform and dot net framework...

Difference between net platform and dot net framework... .net platform supports programming languages that are .net compatible. It is the platform using which we can build and develop the applications. .net framework is the engine inside the .net platform which actually compiles and produces the executable code. .net framework contains CLR(Common Language Runtime) and FCL(Framework Class Library) using which it produces the platform independent codes. What is the .NET Framework? The Microsoft .NET Framework is a platform for building, deploying, and running Web Services and applications. It provides a highly productive, standards-based, multi-language environment for integrating existing investments with next-generation applications and services as well as the agility to solve the challenges of deployment and operation of Internet-scale applications. The .NET Framework consists of three main parts: the common language runtime, a hierarchical set of unified class librari

C++ this Pointer, static, struct and Enumeration

C++ this Pointer In C++ programming,  this  is a keyword that refers to the current instance of the class. There can be 3 main usage of this keyword in C++. It can be used  to pass current object as a parameter to another method. It can be used  to refer current class instance variable. It can be used  to declare indexers. C++ this Pointer Example Let's see the example of this keyword in C++ that refers to the fields of current class. #include <iostream>    using   namespace  std;   class  Employee {       public :           int  id;  //data member (also instance variable)               string name;  //data member(also instance variable)            float  salary;          Employee( int  id, string name,  float  salary)             {                   this ->id = id;                  this ->name = name;                  this ->salary = salary;            }             void  display()             {                 cout<<id<< "  " <<name<&