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

Head First Servlets and JSP phần 6 ppt

74 249 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

Định dạng
Số trang 74
Dung lượng 2,48 MB

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

Nội dung

MDYDXWLO$UUD\/LVWOLVW QHZMDYDXWLO$UUD\/LVW OLVWDGG ³WUXH´ OLVWDGG ³IDOVH´ OLVWDGG ³´ OLVWDGG ³´ UHTXHVWVHW$WWULEXWH ³OLVW´OLVW 6KDUSHQ \RXU SHQFLO IDOVHIDOVHIDOVHIDOVHIDOVH WUXHWUXHWUXH

Trang 2

\RXDUHKHUH 

AW]KIV¼\LW^IRR`

7ITHTHING

QXPVDGG ³´ QXPVDGG ³´ UHTXHVWVHW$WWULEXWH ³QXPEHUV´QXPV 6WULQJ>@IDYRULWH0XVLF ^³=HUR´³7DKLWL´³%7´³)URX)URX´`

Trang 3

 FKDSWHU

$ONTTHISLOOK

3TUDYTHECONSTRUCTTHATLLBROWSER

NOTGOING

Trang 6

\RXDUHKHUH 

<PM-4QUXTQKQ\WJRMK\[

2EMEMBER AREFORAT9OULLSIMPLE

SDUDP9DOXHV KHDGHU KHDGHU9DOXHV FRRNLH LQLW3DUDP

Ooohhhh this is a tough one

could it be a Map of cookies?

(NOT servlet init parameters!)

The only thing that is NOT a Map T his is the real dealÑan actual ref erence to the pageContext object, which you can think of as

a bean Look in the API for the P ageContext getter methods

Trang 7

Þ elds before hitting the submi t button

Even though there might be multiple values for the ÒfoodÓ parameter, you can still use the single param implicit object, but youÕll get only the Þ rst value.

SDUDPDQG SDUDP9DOXHV

Trang 8

+LQWORRNDWWKHRWKHULPSOLFLWREMHFWV

Trang 10

\RXDUHKHUH 

;KWXMQUXTQKQ\WJRMK\[KIV[I^MaW]

)FDONTYOUJUST

/R CAN

^ UHTXHVW6FRSH SHUVRQQDPH`

"UTATTRIBUTECONTROLSCOPING

4HINKIN

*AVAISSOMEWHERE

UHTXHVWVHW$WWULEXWH ³SHUVRQ´S 

"UT

3TRINGS4HATCOULD

UHTXHVWVHW$WWULEXWH ³IRRSHUVRQ´S 

!ND

^ IRRSHUVRQ QDPH`

"UTSCOPE3TRING

NO! This is certainly legal, but the Container

just thinks that ÒfooÓ is an attribute

somewhere, with a ÒpersonÓ property But the

Container never Þnds a ÒfooÓ attribute.

Perfect! Using the requestScope object gives

us a way to put the attribute name in quotes.

Trang 11

&RRNLH>@FRRNLHV UHTXHVWJHW&RRNLHV IRU LQWL LFRRNLHVOHQJWKL ... class="text_page_counter">Trang 26< /span>

aces it into the ỊContact .jsp? ?

SURSULHWDU\(YDOXDWH ³^LQLW3DUDPPDLQ(PDLO`´MDYDODQJ6WULQJFODVV... only used by servlets.

PRFN DQVZHUV

Trang 56< /span>

-Options C and F will cause... loggedOut is true.

(JSP v2.0 pg 1 -69 )

-Option B is incorrect because only the [] will work when accessing a) Lists and arrays, and b) Maps whose keys are not well-formed.

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

TỪ KHÓA LIÊN QUAN