Академический Документы
Профессиональный Документы
Культура Документы
Web AppllcaLlon
- A web application is a seivei-siue application that contains
Web components (Seivlets anu }SP pages), BTNLXNL
uocuments, anu othei iesouices in a uiiectoiy stiuctuie oi
aichiveu foimat known as a Web Aichive (WAR) file
- A web application is accesseu ovei a netwoik, such as the
inteinet oi intianet, using a web biowsei
- Web applications peifoims vaiious opeiations such as
accepting input uata anu uynamically geneiating one oi
moie uocuments as iesponses
- The iesponse web uocuments aie geneiateu anu uisplayeu
in stanuaiu foimats such as BTNL
Web ComponenLs
- In }ava EE platfoim, web components pioviue uynamic
capabilities foi a web seivei. Web components can be }ava
Seivlets oi }ava Seivei Pages(}SP), }ava Seivei Faces(}SF)
- Seivlets aie }ava classes that uynamically piocess iequests
anu geneiate the uesiieu iesponses
- }SP pages aie text-baseu uocuments that aie executeu as
seivlets, pioviue an appioach foi cieating uynamic web
pages
- Web components piocess iequests anu peifoim othei
iequiieu opeiations by help of a iuntime platfoim known
as a web containei
eploymenL escrlpLor
- Ceitain aspects of web applications can be configuieu when
the application is ueployeu on the web containei
- This configuiation infoimation is maintaineu in an XNL file,
calleu Web Application Beployment Besciiptoi
- Foi web applications, the ueployment uesciiptoi must be
calleu web.xml anu must iesiue in the WEBINF uiiectoiy
in the web application ioot.
- Foi }ava EE applications, the ueployment uesciiptoi must
be nameu application.xml anu must be placeu uiiectly in
the NETA-INF uiiectoiy at the top level of the application
.eai file.
@@9 9roLocol
- BTTP is a communication piotocol useu to tiansfei
infoimation on the Inteinet. It is a stateless anu
application-level piotocol.
- As an application level piotocol, BTTP also uefines the
type of iequest that clients can senu to seiveis anu the
type of iesponses that seivei can sent to clients
- Each iequest has a 0RL, which is a stiing that iuentifies a
we b component oi a static object e.g. BTNL page oi
Image file
- Theiefoi to biowse a 0RL anu communicate ovei a
netwoik, java Clients use BTTP
@@9 messages
- Each message, whethei a iequest oi a iesponse,
has thiee paits:
. The iequest oi the iesponse line
. A heauei section
. The bouy of the message
- The piocess of senuing a iequest anu ieceiving a
iesponse fiom the seivei is teimeu as BTTP
tiansaction
@@9 8equesL
GET /index.html HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0
Accept: text/html, */*
Accept-Language: en-us
Accept-Charset: ISO-8859-1,utf-8
Connection: keep-alive
-,330
GET /index.html HTTP/1.1
Host: www.example.com
User-Agent: Mozilla/5.0
Accept: text/html, */*
Accept-Language: en-us
Accept-Charset: ISO-8859-1,utf-8
Connection: keep-alive
-,330
URL Protocol Version Method
Headers
Body
(optional)
@@9 8esponse
HTTP/1.1 200 OK
Date: Thu, 24 Jul 2008 17:36:27 GMT
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=UTF-8
Content-Length: 1846
-,330
html>
...
/html>
HTTP/1.1 200 OK
Date: Thu, 24 Jul 2008 17:36:27 GMT
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=UTF-8
Content-Length: 1846
-,330
html>
...
/html>
$tatus $tatus Message Version
Headers
Body
WhaL Lhe cllenL does parL l
- The client senus a message to the seivei at a
paiticulai poit (8 is the uefault)
- The fiist pait of the message is the iequest line,
containing:
- A methou (BTTP commanu) such as CET oi PDST
- A uocument auuiess, anu
- An BTTP veision numbei
- Example:
- CET /Index.html HTTP/1.0
@@9 meLhods
- CET: Retiieves the iesouice iuentifieu by the iequest 0RL
- PDST: Senus laige amount of complex uata to the seivei
- HEA0: Like CET, but ask that only a heauei be ietuineu
- PUT: Request to stoie a iesouice at the 0RI
- 0ELETE: Request iemoval of uata at the 0RI
- DPTDNS: Request infoimation about communications
options on the seivei
- TFACE: Request that the iesouice be ietuineu as ieceiveu
(useu foi uebugging)
lfferences beLween CL@ and 9@
Parameter CET PUST
Transmission of
request parameters
As a queiy stiing appenueu to
the iequest 0RL
Within the bouy of the iequest
size Limiteu to a max. of chai.
in the 0RL (except the actual
path)
- Not limiteu by the size of the
0RL foi submitting namevalue
paiis.
- These paiis aie tiansfeiieu in
the heauei anu not in 0RL
Purpose 0seu only foi ietiieving uata 0seu foi ietiieving as well as
saving oi upuating uata,
oiueiing a piouuct oi senuing
e-mail
cacbing A uET iequest is often
cacheable
A P0ST iequest can haiuly be
cacheable
Type of purpose 0seu to access static
iecouises e.g. BTNL uoc. Anu
images
0seu to tiansmit a laige
amount of infoimation oi
iequest uepenuent infoimation