Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 75 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
75
Dung lượng
19,97 MB
Nội dung
WKLVLVDQHZFKDSWHU :HEDSSOLFDWLRQVDUHKRW6XUH*8,DSSOLFDWLRQVPLJKWXVHH[RWLF 6ZLQJZLGJHWVEXWKRZPDQ\*8,DSSVGR\RXNQRZWKDWDUHXVHGE\PLOOLRQV RIXVHUVZRUOGZLGH"$VDZHEDSSGHYHORSHU\RXFDQIUHH\RXUVHOIIURPWKH JULSRIGHSOR\PHQWSUREOHPVDOOVWDQGDORQHDSSVKDYHDQGGHOLYHU\RXUDSSWR DQ\RQHZLWKDEURZVHU%XWWREXLOGDWUXO\SRZHUIXOZHEDSS\RXQHHG-DYD <RXQHHGVHUYOHWV<RXQHHG-63V%HFDXVHSODLQROGVWDWLF+70/SDJHVDUHVR ZHOO7RGD\¶VXVHUVH[SHFWVLWHVWKDWDUHG\QDPLFLQWHUDFWLYHDQGFXVWRP WDLORUHG:LWKLQWKHVHSDJHV\RX¶OOOHDUQWRPRYHIURPZHEVLWHWRZHEDSS :K\XVH6HUYOHWV-63V" LQWURDQGRYHUYLHZ <RXIRRO<RXPXVWXVH 6HUYOHWVDQG-63V,I\RX FRQWLQXHWRZULWH3HUO VFULSWV,ZLOOGHVWUR\ \RX +DK,NQRZ &*,0\ZHEVLWHZLOO UXOHWKHZRUOG Chapter 1. Why use Servlets & JSPs? Chapter 1. Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8/1/2004 User number: 747221 Copyright 2006, Safari Books Online, LLC. This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited. FKDSWHU )RUHDFKRIWKH+7730HWKRGVVXFKDV*(7 3267+($'DQGVRRQ 'HVFULEHEHQH¿WVRIWKH+7730HWKRG 'HVFULEHIXQFWLRQDOLW\RIWKH+7730HWKRG /LVWWULJJHUVWKDWPLJKWFDXVHD&OLHQW XVXDOO\D:HEEURZVHUWRXVHWKHPHWKRG $OVRSDUWRI2EMHFWLYHEXWQRWFRYHUHG LQWKLVFKDSWHU ,GHQWLI\WKH+WWS6HUYOHWPHWKRGWKDW FRUUHVSRQGVWRWKH+7730HWKRG 6HUYOHWV-63RYHUYLHZ RI¿FLDO6XQH[DPREMHFWLYHV 4HEOBJECTIVESINTHISSECTIONARECOVERED COMPLETELYINANOTHERCHAPTERSOTHINKOF THISCHAPTERASAlRSTLOOKFOUNDATIONFOR WHATCOMESLATER)NOTHERWORDSDONTWORRY ABOUTlNISHINGTHISCHAPTERKNOWINGAND REMEMBERINGANYTHINGSPECIlCFROMTHESE OBJECTIVESJUSTUSEITFORBACKGROUND)FYOU ALREADYKNOWTHESETOPICSYOUCANJUSTSKIM THISCHAPTERANDJUMPTOCHAPTER 9OUWONTHAVEANYMOCKEXAMQUESTIONSON THESETOPICSUNTILYOUGETTOTHEMORESPECIlC CHAPTERWHERETHOSETOPICSARECOVERED &RYHUDJH1RWHV Chapter 1. Why use Servlets & JSPs? Chapter 1. Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8/1/2004 User number: 747221 Copyright 2006, Safari Books Online, LLC. This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited. Copyright Safari Books Online #747221 LQWURDQGDUFKLWHFWXUH \RXDUHKHUH -^MZaJWLa_IV\[I_MJ[Q\M 9OUHAVEAKILLERIDEAFORAWEBSITE4ODESTROYTHECOMPETITIONYOU NEEDAmEXIBLESCALABLEARCHITECTURE9OUNEEDSERVLETSAND*30S "EFOREWESTARTBUILDINGLETSTAKEALOOKATTHE7ORLD7IDE7EB FROMABOUTKFEET7HATWECAREMOSTABOUTINTHISCHAPTERARE HOWWEBCLIENTSANDWEBSERVERSTALKTOONEANOTHER 4HESENEXTSEVERALPAGESAREPROBABLYALLREVIEWFORYOUESPECIALLYIF YOUREALREADYAWEBAPPLICATIONDEVELOPERBUTITLLGIVEUSACHANCE TOEXPOSESOMEOFTHETERMINOLOGYWEUSETHROUGHOUTTHEBOOK The web consists of gazillions of clients (using browsers like Mozilla or Safari) and servers (using web server apps like Apache) connected through wires and wireless networks. Our goal is to build a web application that clients around the globe can access. And to become obscenely rich. :HE EURZVHU :HE EURZVHU :HE EURZVHU :HE EURZVHU :HE EURZVHU the earth &OLHQW &OLHQW &OLHQW &OLHQW &OLHQW 6HUYHU 6HUYHU 6HUYHU Chapter 1. Why use Servlets & JSPs? Chapter 1. Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8/1/2004 User number: 747221 Copyright 2006, Safari Books Online, LLC. This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited. FKDSWHU !WEBBROWSERLETSAUSERREQUESTARESOURCE4HEWEBSERVERGETSTHE REQUESTlNDSTHERESOURCEANDRETURNSSOMETHINGTOTHEUSER 3OMETIMESTHATRESOURCEISAN(4-,PAGE3OMETIMESITSAPICTURE/R ASOUNDlLE/REVENA0$&DOCUMENT$OESNTMATTERTHECLIENTASKS FORTHETHINGRESOURCEANDTHESERVERSENDSITBACK 5NLESSTHETHINGISNTTHERE/RATLEASTITSNOTWHERETHESERVERIS EXPECTINGITTOBE9OUREOFCOURSEQUITEFAMILIARWITHTHEh.OT &OUNDvERRORTHERESPONSEYOUGETWHENTHESERVERCANTlNDWHATIT THINKSYOUASKEDFOR 7HENWESAYhSERVERvWEMEANEITHERTHEPHYSICALMACHINEHARDWARE ORTHEWEBSERVERAPPLICATIONSOFTWARE4HROUGHOUTTHEBOOKIF THEDIFFERENCEBETWEENSERVERHARDWAREANDSOFTWAREMATTERSWELL EXPLICITLYSAYWHICHONEHARDWAREORSOFTWAREWERETALKINGABOUT ?PI\LWM[aW]Z_MJ[MZ^MZLW' $ZHEVHUYHUWDNHVDFOLHQWUHTXHVWDQGJLYHV VRPHWKLQJEDFNWRWKHFOLHQW UHTXHVW UHVSRQVH &OLHQW :HE EURZVHU 6HUYHU The clientÕs request contains the name and address (the URL), of the thing the client is looking for. The serverÕs response contains the actual document that the client requested (or an error code if the request could not be processed). KWPO! KHDG! KHDG! ERG\! ERG\! KWPO! KWPO! KHDG! KHDG! ERG\! ERG\! KWPO! KWPO! KHDG! KHDG! ERG\! ERG\! KWPO! KWPO! KHDG! KHDG! ERG\! ERG\! KWPO! P\UHTXHVW LV[\] The server usually has lots of ÒcontentÓ that it can send to clients. That content can be web pages, JPEGs, and other resources. KWPO! KHDG! KHDG! ERG\! ERG\! KWPO! ZHEVHUYHU Chapter 1. Why use Servlets & JSPs? Chapter 1. Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8/1/2004 User number: 747221 Copyright 2006, Safari Books Online, LLC. This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited. LQWURDQGDUFKLWHFWXUH \RXDUHKHUH $ZHEFOLHQWOHWVWKHXVHUUHTXHVWVRPHWKLQJRQWKH VHUYHUDQGVKRZVWKHXVHUWKHUHVXOWRIWKHUHTXHVW 7HENWETALKABOUTCLIENTSTHOUGHWEUSUALLYMEANBOTHOREITHER THEHUMANUSERANDTHEBROWSERAPPLICATION 4HEBROWSERISTHEPIECEOFSOFTWARELIKE.ETSCAPEOR-OZILLATHAT KNOWSHOWTOCOMMUNICATEWITHTHESERVER4HEBROWSERSOTHERBIGJOB ISINTERPRETINGTHE(4-,CODEANDRENDERINGTHEWEBPAGEFORTHEUSER 3OFROMNOWONWHENWEUSETHETERMCLIENTWEUSUALLYWONTCARE WHETHERWERETALKINGABOUTTHEHUMANUSERORTHEBROWSERAPP)N OTHERWORDSTHECLIENTISTHEBROWSERAPPDOINGWHATTHEUSERASKEDITTODO ?PI\LWM[I_MJKTQMV\LW' %URZVHU 6HUYHU KWPO! KHDG! KHDG! ERG\! ERG\! KWPO! KWPO! KHDG! KHDG! ERG\! ERG\! KWPO! KWPO! KHDG! KHDG! ERG\! ERG\! KWPO! P\UHTXHVW LV[\] 8VHUFOLFNVDOLQN LQWKHEURZVHU 8VHU %URZVHUIRUPDWVWKH UHTXHVWDQGVHQGVLW WRWKHVHUYHU KWPO! KHDG! KHDG! ERG\! ERG\! KWPO! KWPO! KHDG! KHDG! ERG\! ERG\! KWPO! 6HUYHUÀQGVWKH UHTXHVWHGSDJH %URZVHU 6HUYHU KWPO! KHDG! KHDG! ERG\! ERG\! KWPO! KWPO! KHDG! KHDG! ERG\! ERG\! KWPO! KWPO! KHDG! KHDG! ERG\! ERG\! KWPO! %URZVHUJHWVWKH+70/ DQGUHQGHUVLWLQWRD GLVSOD\IRUWKHXVHU 8VHU 6HUYHUIRUPDWVWKH UHVSRQVHDQGVHQGVLW WRWKHFOLHQWEURZVHU KWPO! KHDG! KHDG! ERG\! ERG\! KWPO! FOLFN Chapter 1. Why use Servlets & JSPs? Chapter 1. Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8/1/2004 User number: 747221 Copyright 2006, Safari Books Online, LLC. This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited. FKDSWHU +TQMV\[IVL[MZ^MZ[ SVW_0<54IVL0<<8 %XWKRZGRWKH FOLHQWVDQGVHUYHUV WDONWRHDFKRWKHU" $ZLVHTXHVWLRQ,QRUGHU WRFRPPXQLFDWHWKH\PXVW VKDUHDFRPPRQODQJXDJH2Q WKHZHEFOLHQWVDQGVHUYHUV PXVWVSHDN+773DQGEURZVHUV PXVWNQRZ+70/ -OSTOFTHECONVERSATIONSHELDONTHE WEBBETWEENCLIENTSANDSERVERSARE HELDUSINGTHE(440PROTOCOLWHICH ALLOWSFORSIMPLEREQUESTANDRESPONSE CONVERSATIONS4HECLIENTSENDSAN (440REQUESTANDTHESERVERANSWERS WITHAN(440RESPONSE"OTTOMLINE IFYOUREAWEBSERVERYOUSPEAK(440 7HENAWEBSERVERSENDSAN(4-, PAGETOTHECLIENTITSENDSITUSING (4409OULLSEETHEDETAILSONHOW ALLTHISWORKSINTHENEXTFEWPAGES &9)(440STANDSFOR(YPER4EXT 4RANSPORT0ROTOCOL +773 7HENASERVERANSWERSAREQUEST THESERVERUSUALLYSENDSSOMETYPE OFCONTENTTOTHEBROWSERSOTHATTHE BROWSERCANDISPLAYIT3ERVERSOFTEN SENDTHEBROWSERASETOFINSTRUCTIONS WRITTENIN(4-,THE(YPER4EXT -ARKUP,ANGUAGE4HE(4-, TELLSTHEBROWSERHOWTOPRESENTTHE CONTENTTOTHEUSER !LLWEBBROWSERSKNOWWHATTODO WITH(4-,ALTHOUGHSOMETIMESAN OLDERBROWSERMIGHTNOTUNDERSTAND PARTSOFAPAGETHATWASWRITTENUSING NEWERVERSIONSOF(4-, +70/ +70/WHOOVWKHEURZVHU KRZWRGLVSOD\WKHFRQWHQW WRWKHXVHU +773LVWKHSURWRFRO FOLHQWVDQGVHUYHUVXVHRQ WKHZHEWRFRPPXQLFDWH 7KHVHUYHUXVHV+773WR VHQG+70/WRWKHFOLHQW +70/DQG+773 Chapter 1. Why use Servlets & JSPs? Chapter 1. Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8/1/2004 User number: 747221 Copyright 2006, Safari Books Online, LLC. This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited. LQWURDQGDUFKLWHFWXUH \RXDUHKHUH <_WUQV]\M0<54O]QLM 7HENYOUDEVELOPAWEBPAGEYOUUSE(4-,TODESCRIBEWHATTHE PAGESHOULDLOOKLIKEANDHOWITSHOULDBEHAVE (4-,HASDOZENSOFTAGSANDHUNDREDSOFTAGATTRIBUTES4HEGOALOF (4-,ISTOTAKEATEXTDOCUMENTANDADDTAGSTHATTELLTHEBROWSER HOWTOFORMATTHETEXT"ELOWARETHETAGSWEUSEINTHENEXTSEVERAL CHAPTERS)FYOUNEEDAMORECOMPLETEUNDERSTANDINGOF(4-,WE RECOMMENDTHEBOOK(4-,8(4-,4HE$ElNITIVE'UIDE ! D! DOLJQ! ERG\! EU! FHQWHU! IRUP! K! KHDG! KWPO! LQSXWW\SH! S! WLWOH! WHEREYOUPUTYOURCOMMENTS ANCHORUSUALLYFORPUTTINGINAHYPERLINK ALIGNTHECONTENTSLEFTRIGHTCENTEREDORJUSTIlED DElNETHEBOUNDARIESOFTHEDOCUMENTSBODY ALINEBREAK CENTERTHECONTENTS DElNEAFORMWHICHUSUALLYPROVIDESINPUTlELDS THElRSTLEVELHEADING DElNETHEBOUNDARIESOFTHEDOCUMENTSHEADER DElNETHEBOUNDARIESOFTHE(4-,DOCUMENT DElNESANINPUTWIDGETTOAFORM ANEWPARAGRAPH THE(4-,DOCUMENTSTITLE 7DJ 'HVFULSWLRQ (Technically, the <center> and <align> tags have been deprecated in HTML 4.0, but weÕre using them in some of our examples because itÕs simpler to read than the alternative, and youÕre not here to learn HTML anyway.) Chapter 1. Why use Servlets & JSPs? Chapter 1. Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8/1/2004 User number: 747221 Copyright 2006, Safari Books Online, LLC. This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited. FKDSWHU KWPO! 6RPHVDPSOH+70/! KHDG! WLWOH!$/RJLQ3DJHWLWOH! KHDG! ERG\! KDOLJQ ´FHQWHU´!6N\OHU¶V/RJLQ3DJHK! SDOLJQ ´ULJKW´! LPJVUF ´6.</(5MSJ´ZLGWK ´´KHLJKW ´´! S! IRUPDFWLRQ ´GDWH´! 1DPHLQSXWW\SH ´WH[W´QDPH ´SDUDP´!EU! 3DVVZRUGLQSXWW\SH ´WH[W´QDPH ´SDUDP´!EU!EU!EU! FHQWHU! LQSXWW\SH ´68%0,7´! FHQWHU! IRUP! ERG\! KWPO! The <img> tag is nested inside a paragraph <align> tag in order to place the image roughly where we want it. (Remember, <align> is deprecated, but weÕre using it because itÕs simple to read.) The ÒsubmitÓ button in the form. ?PI\aW]_ZQ\M \PM0<54 The <br> tags cause line breaks. An HTML comment The servlet to send the request to. )MAGINEYOURECREATINGALOGINPAGE4HESIMPLE(4-, MIGHTLOOKSOMETHINGLIKETHIS $ % & ' ( WeÕll talk more about forms later, but brießy, the browser can collect the userÕs input and return it to the server. <RXQHHGRQO\WKHPRVWEDVLF+70/ NQRZOHGJH (4-,POPSUPALLOVERTHEEXAM"UTYOURE NOTBEINGTESTEDONYOUR(4-,KNOWLEDGE9OULLSEE (4-,INTHECONTEXTOFALARGECHUNKOFQUESTIONS THOUGHSOYOUNEEDATLEASTSOMEIDEAOFWHATS HAPPENINGWHENYOUSEESIMPLE(4-, ZULWLQJ +70/ Chapter 1. Why use Servlets & JSPs? Chapter 1. Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8/1/2004 User number: 747221 Copyright 2006, Safari Books Online, LLC. This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited. LQWURDQGDUFKLWHFWXUH \RXDUHKHUH ?PI\\PMJZW_[MZKZMI\M[ 4HEBROWSERREADSTHROUGHTHE(4-,CODECREATESTHE WEBPAGEANDRENDERSITTOTHEUSERSDISPLAY $ % & ' ( KWWSZZZZLFNHGO\VPDUWFRPVN\ORJLQKWPO Chapter 1. Why use Servlets & JSPs? Chapter 1. Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8/1/2004 User number: 747221 Copyright 2006, Safari Books Online, LLC. This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited. FKDSWHU (440RUNSONTOPOF4#0)0)FYOURENOTFAMILIARWITH THOSENETWORKINGPROTOCOLSHERESTHECRASHCOURSE4#0 ISRESPONSIBLEFORMAKINGSURETHATAlLESENTFROMONE NETWORKNODETOANOTHERENDSUPASACOMPLETElLEATTHE DESTINATIONEVENTHOUGHTHElLEISSPLITINTOCHUNKSWHEN ITSSENT)0ISTHEUNDERLYINGPROTOCOLTHATMOVESROUTES THECHUNKSPACKETSFROMONEHOSTTOANOTHERONTHEIR WAYTOTHEDESTINATION(440THENISANOTHERNETWORK PROTOCOLTHATHAS7EBSPECIlCFEATURESBUTITDEPENDS ON4#0)0TOGETTHECOMPLETEREQUESTANDRESPONSE FROMONEPLACETOANOTHER4HESTRUCTUREOFAN(440 CONVERSATIONISASIMPLE2EQUEST2ESPONSESEQUENCEA BROWSERREQUESTSANDASERVERRESPONDS ?PI\Q[\PM0<<8XZW\WKWT' <RXGRQ¶WKDYHWRPHPRUL]HWKH+773VSHF 4HE(440PROTOCOLISAN)%4&STANDARD2&#)FYOUCARE &ORTUNATELYTHEEXAMDOESNTEXPECTYOUTO!PACHEISANEXAMPLE OFA7EBSERVERTHATPROCESSES(440REQUESTS-OZILLAISANEXAMPLE OFA7EBBROWSERTHATPROVIDESTHEUSERWITHTHEMEANSTOMAKE(440 REQUESTSANDTOVIEWTHEDOCUMENTSRETURNEDBYTHESERVER +773UHTXHVW +773UHVSRQVH &OLHQW :HE EURZVHU 6HUYHU .H\HOHPHQWVRIWKHUHTXHVW VWUHDP +773PHWKRGWKHDFWLRQWR EHSHUIRUPHG 7KHSDJHWRDFFHVVD85/ )RUPSDUDPHWHUVOLNH DUJXPHQWVWRDPHWKRG .H\HOHPHQWVRIWKH UHVSRQVHVWUHDP $VWDWXVFRGHIRUZKHWKHU WKHUHTXHVWZDVVXFFHVVIXO &RQWHQWW\SHWH[WSLFWXUH +70/HWF 7KHFRQWHQWWKHDFWXDO +70/LPDJHHWF +773SURWRFRO Chapter 1. Why use Servlets & JSPs? Chapter 1. Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8/1/2004 User number: 747221 Copyright 2006, Safari Books Online, LLC. This PDF is exclusively for your use in accordance with the Safari Terms of Service. No part of it may be reproduced or transmitted in any form by any means without the prior written permission for reprints and excerpts from the publisher. Redistribution or other use that violates the fair use priviledge under U.S. copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited. [...]... copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited Chapter 1 Why use Servlets & JSPs? Chapter 1 Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8 /1/ 2004 User number: 7472 21 Copyright 2006,... copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited Chapter 1 Why use Servlets & JSPs? Chapter 1 Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8 /1/ 2004 User number: 7472 21 Copyright 2006,... copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited Chapter 1 Why use Servlets & JSPs? Chapter 1 Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8 /1/ 2004 User number: 7472 21 Copyright 2006,... copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited Chapter 1 Why use Servlets & JSPs? Chapter 1 Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8 /1/ 2004 User number: 7472 21 Copyright 2006,... copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited Chapter 1 Why use Servlets & JSPs? Chapter 1 Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8 /1/ 2004 User number: 7472 21 Copyright 2006,... copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited Chapter 1 Why use Servlets & JSPs? Chapter 1 Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8 /1/ 2004 User number: 7472 21 Copyright 2006,... copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited Chapter 1 Why use Servlets & JSPs? Chapter 1 Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8 /1/ 2004 User number: 7472 21 Copyright 2006,... copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited Chapter 1 Why use Servlets & JSPs? Chapter 1 Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8 /1/ 2004 User number: 7472 21 Copyright 2006,... copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited Chapter 1 Why use Servlets & JSPs? Chapter 1 Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8 /1/ 2004 User number: 7472 21 Copyright 2006,... copyright laws (see 17 USC107) or that otherwise violates the Safari Terms of Service is strictly prohibited Chapter 1 Why use Servlets & JSPs? Chapter 1 Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham ISBN: 0596005407 Publisher: O'Reilly Prepared for Stephen Goss, Safari ID: stephengoss@gmx.net Print Publication Date: 8 /1/ 2004 User number: 7472 21 Copyright 2006, . prohibited. FKDSWHU )RUHDFKRIWKH+7730HWKRGVVXFKDV*(7 3267+($'DQGVRRQ 'HVFULEHEHQH¿WVRIWKH+7730HWKRG 'HVFULEHIXQFWLRQDOLWRIWKH+7730HWKRG /LVWWULJJHUVWKDWPLJKWFDXVHD&OLHQW XVXDOOD:HEEURZVHUWRXVHWKHPHWKRG $OVRSDUWRI2EMHFWLYHEXWQRWFRYHUHG LQWKLVFKDSWHU ,GHQWLIWKH+WWS6HUYOHWPHWKRGWKDW FRUUHVSRQGVWRWKH+7730HWKRG 6HUYOHWV-63RYHUYLHZ RI¿FLDO6XQH[DPREMHFWLYHV 4HEOBJECTIVESINTHISSECTIONARECOVERED COMPLETELYINANOTHERCHAPTERSOTHINKOF THISCHAPTERASAlRSTLOOKFOUNDATIONFOR WHATCOMESLATER)NOTHERWORDSDONTWORRY ABOUTlNISHINGTHISCHAPTERKNOWING AND REMEMBERINGANYTHINGSPECIlCFROMTHESE OBJECTIVESJUSTUSEITFORBACKGROUND)FYOU ALREADYKNOWTHESETOPICSYOUCANJUSTSKIM THISCHAPTER AND JUMPTOCHAPTER 9OUWONTHAVEANYMOCKEXAMQUESTIONSON THESETOPICSUNTILYOUGETTOTHEMORESPECIlC CHAPTERWHERETHOSETOPICSARECOVERED &RYHUDJH1RWHV Chapter 1. Why use Servlets & JSPs? Chapter 1. Why use Servlets & JSPs? Head First Servlets and JSP By Bert Bates, Kathy Sierra, Bryan Basham. JPEGs, and other resources. KWPO! KHDG! KHDG! ERG! ERG! KWPO! ZHEVHUYHU Chapter 1. Why use Servlets & JSPs? Chapter 1. Why use Servlets & JSPs? Head First Servlets and JSP. Ò?Ó, and with each parameter (name/value pair) separated by an ampersand Ò Ó. Not shown: Chapter 1. Why use Servlets & JSPs? Chapter 1. Why use Servlets & JSPs? Head First Servlets and