Showing posts with label java script. Show all posts
Showing posts with label java script. Show all posts

Monday, January 20, 2014

Introduction to Web Applications Part-II

Introduction:

We already know web application can be categories into two types
  1. Static web applications
  2. Dynamic Web Applications

Go through following links to web application introduction part  I


Static Web Applications

A static web application deliver response to user what exactly stored in server. The response is always same for all users when they requested to server. It means static html pages, pdf files and images.

These resources are available in server so that when the user requested to server and the server will serve as response. The user will be requested as simple http request to the server so that server will serve the static recourses as response. To handle request and manage these recourse we will use web server.

What is web server?

A web server is server to handle or process the http request and serve the response to the end users.

We already know http request is simple URL and it will ask the web server for response on behalf of user.

The popular web server in the market is Apache Web Server. In the world most of the web servers are Apache Web servers


For example we will request for one html page that html page contains the company information.


When we send above request to the web server it will always give the static data which is presented in requested html page. It means the response data always same for all user requests.
.

The following is more information about Apache Http server


The final bottom line is static web applications always serve same response to users and to manage these static web applications we will use web servers.

Dynamic Web Application

Dynamic web application serves the response based on user demand and the response is varying based on user request.

It will generate dynamic response to end user when they request to the server. Here http request is same but based on user the content/data will be changed.

For example it will use same resource for every request but the resource will be generating the dynamic content based on user request.

We can assume we want employee information and for this each request we call same resource but it will give different employee information


If we observe above request, based on employee Id we will get different employee information but each time it will execute same resource in server.

The following diagram shows the web application in server


In above diagram user send the request to get employee information and server execute same resource and that recourse get employee data from information system and give response back to the user.

Who will produce Dynamic Response?

In dynamic web applications to produce dynamic response we need special kind of resources and these resources are called helper applications.

Helper application are kind of recourses will be executes in server to prepare dynamic response. To execute helper applications we need containers.

Helper application is server side technology to produce dynamic response based on users demand.

What is container?

Containers are managing helper applications it means it will process helper application to produce dynamic response. Processing of helper application is like execution of helper applications.

Containers are responsible for managing liferay cycle of helper application when they producing dynamic response. The example for helper application in Java is servlet

Servlet is helper appellation or server side component to produce dynamic request to the user.
To execute servlet we need servlet container. The servlet container is responsible for execution of servlet or manages the life cycle of servlet when they produce dynamic request.

We have different containers in java like servlet container, EJB container and JMS container.
Static Web application can be served by Web servers but dynamic applications cannot so that dynamic web application needs application servers.

What is Application Server?

Application server is like web server to handle http request besides that it will also manage the dynamic applications.

We already know to execute dynamic application we need containers. Application server has ability to integrate with many containers like servlet, EJB and JSM containers.

Application server is used to manage dynamic web application.

We already know we need helper application or servlet to process dynamic request. To produce dynamic response it will use some information system for getting the data. Those information systems are like databases.

Servlet need database to produces dynamic response. The response is in the form of browser understandable language that is html.

Servlet can produce response in the form of HTML or other formats like text, images and files formats but all these formats should understand by browser.

Note:

In the real environment we will use combination of Web server and Application Server

General Request flow in Dynamic Web application
  • The user/client sends the request to the server.
  • Server will identify the request whether it is dynamic request or static request.
  • If static request then web server handle the request means it will process request and produces the response.
  • If dynamic request then web server delegates the request to helper application so that helper application processes the dynamic request and it will generate the response. Helper application will take the container help to produce the response.
  • The response will give to the web server and web server is responsible to send response to client.

The following diagram depicts the flow of dynamic request.



In java we will use servlet to process dynamic request and we use servlet to build dynamic web applications.

What is servlet?

Servlet is server side technology to produce dynamic response. Servlet will be executed in servlet containers when they produce dynamic response. Servlet container will manage the lifecycle of servlet.

Important Points
  • We have two different kinds of web applications static and dynamic.
  • Static application will be managed by web servers and dynamic applications are managed by application server.
  • To produce dynamic response we need helper applications and these helper application need container to execute and produce response.
  • Helper application is server side technology and example in java is servlet.
  • Application server has ability to accommodate different container like servlet, EJB and JMS containers.
Related Articles



Author
Liferay Top Contributor Award Winner

Wednesday, January 15, 2014

Introduction to Web Applications Part-I

Introduction:

A web application is set of resources which will be available in universally. Resources are like files, images and any data which is informative.

Each web application has its own unique location in the internet so that we can access the web application.

To represent any web application in internet we will use domain or IP address this is called address of application. This address is unique in the web world or internet which gives you the destination point of web application.

When we talk about web application we need to consider two things that are Server and Client.
As we know web application have destination point these destination point is server. Server is one kind of software which manages the web application. A client is requesting for server to get response from server.

Web application is implemented by Client Server Architecture.

Client Server Architecture:


Client server architecture is working based on request and response mechanism. Client is always request for the server to get response. The response is like file, images or data.
We know response is generated by server and request is send by client.

What is client in real world?

In internet world a client is software which is able to send request to the server. Once it gets server response it should able to view the response to real world. Here we can say client is able to view the response and response consist of images, files and data.

In web application world a client is web browser. We are very familiar with web browser so some web browsers like Internet Explorer, Mozilla Fire Fox and Chrome.

So the bottom line is client is web browser that can send request to server and it can view the service response to out side world.

What is server in real World?

A server is also software which manages the web application that means it is managing resources. It is always serving the response to the client when client sends request to server. We have many servers in real world like Apache server, Tomcat Server and JBoss server.

Well we understand server and client.

Client Server Communication

We are talking client sends request and serve will give the response to client. How the request will be sent to server and how response will be reached by client.

We need a language that should communicate client and server. That language should understand by both server and client.

This language is called HTTP. Http is mechanism which will used to communicate client and server.

Hyper Text Transfer Protocol (http) is making the communication between client and server and it has some set of rules that will be followed by client and server.

In the real world http is like URL it represent the client request. Http can understand by only client that’s web browser and server.

Whenever client needs some resource or data it will send his request in the form of URL. This URL request can be understand by server so that it will send required response to the client based on what client is looking for.

Each URL request has some parameters these parameters will be decide what kind of response should be generated by server.

How client can display response?

In web world client is web browser how do browser can view the server response, here we need some specialize language that should be understand by browser the language is called HTML.
HTML is way of view the response in browser. The browser can understand only one language called Hyper Text Markup Language (HTML) so that server which is going to send to the browser should be HTML format.

Apart from HTML browsers can display different format data like images, PDF and some file formats. The default response format is always HTML format.

What is HTML?

HTML is specialize language for web browsers. It is tag based language it have many tags to display data in browsers.

The more about HTML go through following link


Html is just tag based language it only show the content in the page but if we want perform some actions or events in the browser it will use another language that is called scripting language.
Scripting languages are specialize languages for browser so that  we can perform some actions and events in the web page.

Java Script is very popular scripting language for the web browsers.

The following link will give more information about java script


We already know HTML can view the response in browser to real world people. The data which we displayed in the browser need some styles or colors so that it will be better look and feel to people.

To make content beautiful in the browser we need some other language that is called Cascading Style Sheets (CSS)

CSS will give better look and feel to the data so that I will be attractable.

The following is more about CSS


The bottom line is the response is in the form of HTML and html data need some other languages support to make content beautiful and perform some action in browser for this reason we need another languages like CSS and Java Script.

Well we have good understanding about web application and it working in real world.

In real world web application can categorized in two types
  1. Static Web Applications
  2. Dynamic Web Applications
We will discuss more in the next part of my articles

Author

Recent Posts

Recent Posts Widget

Popular Posts