Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Servlet Notes

Servlet Notes

Ratings: (0)|Views: 116|Likes:
Published by Ankit Jain

More info:

Published by: Ankit Jain on Nov 15, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

12/04/2012

pdf

text

original

 
Web application:-
A
web application is nothing but a web site.
A
web application can be thought of as a collection of two types of resources
1.
Static Resources: - Normally non-executable resources.A web client can ask for any static resources by just specifying the URL. Web serversimply returns the specified resources to the client without doing any processing. ItMay be:-I.HTMLII.Images/Audio and video filesIII.AppletsIV.Documents / spreadsheet /text files etc.
2.
Dynamic Resources :- they are Executable resources The dynamic resources are also accessed by directly or indirectly specifying the URL.But the action taken by web server is different in case of dynamic resources. In thiscase server executes the appropriate components and then returns the result to theclient normally as HTML using HTTP protocolIt may be:-i.JSPii.Servlets
A web application is deploy on the web-server and are normally accessed through the webclients, which is normally a web browser.
 The communication between web client and web-server takes place through HTTPprotocol.
CGI (Common Gateway Interface):
CGI technology enables the web server to call an external program and pass HTTP request information to theexternal program to process the request.
Problems in CGI:
 
There are many problems in CGI technology:1.If number of client increased, response time very less.2.For each request, it starts a process. Web server is limited to start process.3.It uses plateform dependent language e.g. C,C++,perl.
HTTP (Hyper Text Transfer Protocol):
Http is the protocol that allows web servers and browsers to exchange data over the web.
It is a stateless TCP/IP based protocol used for Communicating on the World Wide Web. HTTP defines the manner inwhich web clients communicate with web servers. Today, the most common version of this is HTTP/1.0.HTTP alsocalled a connectionless protocol.A protocol is said to be stateless if it has no memory of prior connections and cannot distinguish one client’s requestfrom that of another. The stateless nature of HTTP is both its strength and weakness. The strength is that its statelessnature keeps the protocol simple and straightforward. The disadvantage is in the overhead required to create a newconnection with each request and the inability to track a single user. That is, using HTTP, a client opens a connectionwith the server, and sends requests, receives a response and closes the connection. Each request requires its ownconnection. Now let us take a close look how HTTP helps to communicate between a web server and a web browser.There are generally four stages of a simple web transaction:
1.The client opens a connection to the server:
First, the client opens a TCP/IP connection to the server. By default, the connection on the server is made to port 80, unless or otherwise specified.
2.The client makes a request to the server:
Let us assume that the web browser makes a request to retrieve an HTML file. For this, the user enters theRequired URL into the web browser. This request is broken into three parts: the request method, the source Name and the protocol.
3.The server responds to the request:
The server gets the request from the browser. The server responds with a status code, various header files andIf possible, contents of the request.
4. Connection is closed
Either the server or the client may close the connection. The server generally terminates the connection after The response has been sent. Similarly, a browser often closes the connection once the complete response hasBeen received.
Http Request Methods:
Every request has a header that tells the status of the client. There are many request methods. Get andPost requests are mostly used. The http request methods are:
GET
POST
HEAD
PUT
 
DELETE
OPTIONS
TRACE
HTTP RequestMethodDescriptionGET
Asks to get the resource at the requested URL.
POST
Asks the server to accept the body info attached. It like a GET with extra info sent withthe request.
HEAD
Asks for only the header part of whatever a GET would return. Just like GET but with no body.
TRACE
Asks for the loopback of the request message, for testing or troubleshooting.
PUT
Says to put the enclosed info (the body) at the requested URL.
DELETE
Says to delete the resource at the requested URL.
OPTIONS
Asks for a list of the HTTP methods to which the thing at the request URL can respond
Difference between Get and 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 besent because data is sent in body.2) Get request is not secured because data is exposed inURL bar.Post request is secured because data is not exposed inURL bar.3) Get request can be bookmarkedPost request cannot be bookmarked4) Get request is idempotentPost request is non-idempotent5) Get request is more efficient and used than PostPost request is less efficient and used.
Anatomy of Get Request:

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->