1. Trang chủ
  2. » Công Nghệ Thông Tin

Head First Servlets and JSP phần 10 pps

83 257 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề The Power of Filters
Tác giả Bert Bates, Kathy Sierra, Bryan Basham
Người hướng dẫn Augusto Jaramillo Forcada
Trường học O'Reilly
Chuyên ngành Computer Science
Thể loại Chapter
Năm xuất bản 2004
Thành phố Sebastopol
Định dạng
Số trang 83
Dung lượng 2,37 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

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 1

 FKDSWHU

<PZMM_Ia[NQT\MZ[IZMTQSM[MZ^TM\[

+IMSTHEYREWAYS

*USTHAVE

DO'ET DO0OST

!CANPLACETO

¿OWHUVDUHOLNH VHUYOHWV

Trang 2

But 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 3

ALREADYTHEOTHERNEEDS

&ILTER#HAIN IN

"Y

&ILTER

YOU DO&ILTER

GONNA

BIT(ERES

4HEOFNEXTSERVICE

&ILTER

WAS4HISACHAIN

ORCOURSE REQUESTLOCATENEVER

¿OWHU OLIHF\FOH

Trang 4

GR)LOWHU UUF

Trang 6

\RXDUHKHUH 

4HINKTHATREQUESTEDOR

Trang 9

6HUYOHW$

VHUYLFH 0\&RPSUHVVLRQ)LOWHU

Trang 10

DIIHFWWKHRXWSXW

2XWSXW6WUHDP

5HTXHVWDQG

5HVSRQVH



5HVSRQVH6HUYOHW

Trang 12

to 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

Ngày đăng: 12/08/2014, 19:20