The ÒMyResponseÓ object also has a custom output stream that compresses the data written by the servlet, and then sends the compressed data to the original output stream that goes back t
Trang 1FKDSWHU
<PZMM_Ia[NQT\MZ[IZMTQSM[MZ^TM\[
+IMSTHEYREWAYS
*USTHAVE
DO'ET DO0OST
!CANPLACETO
¿OWHUVDUHOLNH VHUYOHWV
Trang 2But weÕre pretty sure that we can cast the request and response to their HTTP subtypes.
This is how the next Þ lter or servlet
in line gets called - lots more on this
in the next couple of pages.
Trang 3ALREADYTHEOTHERNEEDS
&ILTER#HAIN IN
"Y
&ILTER
YOU DO&ILTER
GONNA
BIT(ERES
4HEOFNEXTSERVICE
&ILTER
WAS4HISACHAIN
ORCOURSE REQUESTLOCATENEVER
¿OWHU OLIHF\FOH
Trang 4GR)LOWHUUUF
Trang 6\RXDUHKHUH
4HINKTHATREQUESTEDOR
Trang 96HUYOHW$
VHUYLFH 0\&RPSUHVVLRQ)LOWHU
Trang 10DIIHFWWKHRXWSXW
2XWSXW6WUHDP
5HTXHVWDQG
5HVSRQVH
5HVSRQVH6HUYOHW
Trang 12to the ÒrealÓ response object.
The ÒMyResponseÓ object also has a custom output stream that compresses the data written by the servlet, and then sends the compressed data to the original output stream (that goes back to the client).
The Þ lter passes a custom ÒMyResponseÓ, which implements HttpServletResponse (instead of the original REAL response the Container passed to the Þ lter).
Trang 13"UTCREATING(TTP3ERVLET2ESPONSECLASSCREATED
DGG&RRNLH DGG'DWH+HDGHU DGG+HDGHU HQFRGH5HGLUHFW85/
HQFRGH85/ ... ỊPresentation TierĨ
This is where the servlets and JSPs live
As a web site gets more hits, more servers can be added to handle the load
Trang...properties Þ le to provide key/value
mappings, and in your JSP, you can
invoke a special tag for the key, and
the mapped text will be displayed.... method, used by the Þ lter, gives the compression Þ lter a handle on the GZIP output stream so that the Þ lter can
ỊÞ nishĨ and ß ush the GZIP stream.
UHVSRQVHFRPSUHVVLRQ