Sunday, November 15, 2009

How Web Application Works?

A web application is different from window application, in many ways. First and foremost difference is this, that web application does not run on a single thread as window application runs. Second main difference is to run window application there’s an executable file which runs the application, but to run a web application, browser application executable is used, i.e to work with web application, you need a browser, through which you can use web application, so there is a dependency of browser application to run web application on users system.
There are two key players in running the show for the web application are: Web Browser and Web Server.
Web Browser works on user (client ) side and Web Server works on Server Side. The following steps are usually involved in the communication process between browser and web server are as follows:
1. A user initiates a request by typing in a url in address bar of the web browser (say: http://www.yahoo.com).
2. A request is send to the web server using HTTP protocol, and GET method to web server hosting the web application.
3. The Web Server (Yahoo.com web server), processes the request, as this request is for default page (Home Page), retrieves the code for the default page, and run it.
4. After running the code, the output produced is in the form of html and java script, which is sent back to the web browser using same HTTP protocol.
5. The web browser then processes the response and displays the web page (www.yahoo.com home page).
6. User may then fill in some data in the form provided in the web page (Say for login to yahoo, user name and password, or for registration some information ), and sends the request with the data filled using POST method to the web server again using HTTP protocol.
7. Web server will receive the request and process the data and send back the response to the web browser.
8. Web browser will receive the response and will display the web page.
This process is repeated over a web application session. Therefore this concludes that the key players for web application is HTTP Protocol for communication, Web Browser – Software to display web page and web form, and process HTML and Java Script, and Web Server- Server, to process the request of the user sent from web browser.