-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathajax.txt
20 lines (20 loc) · 1.4 KB
/
ajax.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
With Ajax, you can create richer, more dynamic Web application user
interfaces.i.e. client side. On the other hand servlet requests are
on server side to handle request sent from the UI.
When the visitor requests a page, the server will send the full
HTML and CSS code at once. After the visitor fills in a form and submits it,
the server processes the information( Servlet Request object provides client
request information to a servlet. The servlet container creates a ServletRequest
object and passes it as an argument to the servlet's service method) and rebuilds
the page. It then sends the full page back to the client. And so on.
When using AJAX, the page is loaded entirely only once,
the first time it is requested. Besides the HTML and CSS code that make up the page,
some JavaScript files are also downloaded: the AJAX engine.
All requests for data to the sever will then be sent as JavaScript calls
to this engine. The AJAX engine then requests information from the web server
asynchronously ( servlet request object contains request parameters,which have got
changed). Thus, only small page bits are requested and sent to the browser, as
they are needed by the user. The engine then displays the information without
reloading the entire page. This leads to a much more responsive interface,
because only the necessary information is passed between the client and server,
not the whole page.