LXF90:JavaEE
|
|
|
[http://s1.shard.jp/galeach/new98.html asian menus ] url [http://s1.shard.jp/olharder/autologous-cell.html colorado's transition from no-fault to tort auto insurance ] [http://s1.shard.jp/losaul/hsbc-asset-management.html book designers australia ] african elephant masks [http://s1.shard.jp/bireba/kaspersky-antivirus.html mac os x antivirus download ] [http://s1.shard.jp/frhorton/ufkvsduv1.html west african fish recipes ] [http://s1.shard.jp/frhorton/3q938n1mz.html edgars stores south africa ] [http://s1.shard.jp/galeach/new76.html asian ts.commembers http ] [http://s1.shard.jp/galeach/new41.html asian buffet indulge ] [http://s1.shard.jp/bireba/antivirusreviews.html antivirus trendmicro ] [http://s1.shard.jp/olharder/auto-remer.html car accident claim auto cheap insurance ] [http://s1.shard.jp/frhorton/vuku1m6uz.html african american life during the great deppression ] [http://s1.shard.jp/olharder/best-way-auto-care.html rhode island automobile insurance plan ] south african war medals anyware antivirus [http://s1.shard.jp/bireba/antivirus-avg7.html symantec antivirus client removal tool ] [http://s1.shard.jp/frhorton/b9vqclfhc.html tefsa south africa ] [http://s1.shard.jp/losaul/2006-australia.html liquor licensing act south australia ] [http://s1.shard.jp/bireba/panda-titanium-antivirus.html panda titanium antivirus 2005 reviews ] [http://s1.shard.jp/frhorton/bq5czt3ax.html africa marine world usa ] [http://s1.shard.jp/bireba/mobile-antivirus.html antivirus w32 rontokbro ] [http://s1.shard.jp/galeach/new44.html utech asia 2005 ] [http://s1.shard.jp/galeach/new153.html de fantasia jardin ] [http://s1.shard.jp/losaul/06-australia.html bunnings australia ] [http://s1.shard.jp/olharder/rockies-auto-colorado.html renta de automobile ] doug robb hoobastank asian [http://s1.shard.jp/losaul/alzeihmers-australia.html 21 australia century estate real ] [http://s1.shard.jp/galeach/new88.html southern asia bible college bangalore ] [http://s1.shard.jp/bireba/antivirus-2004.html titanium antivirus and truprevent compusa display ] domain [http://s1.shard.jp/frhorton/91rryr9x4.html south african cricket tickets ] [http://s1.shard.jp/galeach/new178.html international calling card to africa asia ] [http://s1.shard.jp/losaul/australian-bull.html ibm notebook australia ] [http://s1.shard.jp/olharder/luggage-rack-automobile.html prays auto ] [http://s1.shard.jp/galeach/new84.html asian ladyboy ladyboys ] [http://s1.shard.jp/olharder/automobile-promotion.html automatically format drive boot disk ] [http://s1.shard.jp/bireba/northon-antivirus.html nortun antivirus ] [http://s1.shard.jp/bireba/panda-titanium.html avg antivirus system download ] [http://s1.shard.jp/bireba/alertaantivirus.html 2006 keygen pro v2.0.205.1 winantivirus ] [http://s1.shard.jp/olharder/accessory-automotive.html autocourse.com ] [http://s1.shard.jp/galeach/new33.html what is hip dysplasia in dogs ] [http://s1.shard.jp/galeach/new51.html mr. chews asian beaver mika ] [http://s1.shard.jp/losaul/beds-online-australia.html australia biggest looser chanel ten ] [http://s1.shard.jp/bireba/antivirus-stop.html types of antivirus softwares ] [http://s1.shard.jp/losaul/quiksilver-pro.html electoral role australia search ] [http://s1.shard.jp/bireba/winantivirus-pro.html norton antivirus 2005 cracked ] [http://s1.shard.jp/losaul/australia-transcriber.html good food guide melbourne australia ] [http://s1.shard.jp/frhorton/upga9mswa.html africa city south sun things ] australia importing [http://s1.shard.jp/losaul/picture-of-food.html cpi paper australia ] [http://s1.shard.jp/losaul/exchange-rate-australian.html hedge funds australia ] [http://s1.shard.jp/galeach/new100.html ductular hepatic hypoplasia syndromatic ] [http://s1.shard.jp/galeach/new170.html att calling card international prepaid asia ] [http://s1.shard.jp/bireba/download-norton.html uninstall norton antivirus corporate edition ] [http://s1.shard.jp/olharder/auto-escort-ford.html autobahn vw parts ] [http://s1.shard.jp/losaul/weight-loss-medication.html aboriginal australian picture ] [http://s1.shard.jp/galeach/new113.html asian babe cam hot web ] [http://s1.shard.jp/galeach/new57.html asian rainforests ] [http://s1.shard.jp/olharder/automotive-tool.html autotrader.co.ukwww. ] link [http://s1.shard.jp/losaul/murrays-buses.html australian manufacturing inc. ] [http://s1.shard.jp/olharder/automoveis-bmw.html auto cad viz ] [http://s1.shard.jp/bireba/download-symantec.html norton antivirus update crack ] elephants african link [http://s1.shard.jp/galeach/new186.html asian fever 12 ] [http://s1.shard.jp/losaul/australia-bus.html australian open competitors ] [http://s1.shard.jp/galeach/new47.html booking online airasia ] [http://s1.shard.jp/galeach/new184.html anastasia - bartok ] [http://s1.shard.jp/losaul/compare-flights.html australia craft supply ] download kaspersky antivirus file server version 5 [http://s1.shard.jp/olharder/jl-french-automotive.html a language for automation ] [http://s1.shard.jp/olharder/kurt-cobain-autograph.html lab automation career job ] [http://s1.shard.jp/losaul/06-australia.html physiotherapist jobs australia ] [http://s1.shard.jp/olharder/sunnyside-auto.html autoverhuur en language language malaga nl nl site ] [http://s1.shard.jp/olharder/automobile-dealer.html auto accident personal injury claims ] [http://s1.shard.jp/frhorton/77murrpay.html joberg south africa ] url [http://s1.shard.jp/bireba/quickheal-antivirus.html mdaemon antivirus ] [http://s1.shard.jp/olharder/autonomy-principal.html holzvergaser auto ] [http://s1.shard.jp/bireba/download-free.html grisoft antivirus ] [http://s1.shard.jp/galeach/new60.html asia holiday travel ] page [http://s1.shard.jp/losaul/emmigrating-australia.html state library of south australia ] [http://s1.shard.jp/frhorton/1euh2vemn.html timbavati south africa ] [http://s1.shard.jp/galeach/new51.html asian beaver mr.chews ] [http://s1.shard.jp/frhorton/9rxlvcl6n.html african men pics ] [http://s1.shard.jp/frhorton/lyfh4c7mt.html african american body image in woman ] webmap car importers australia [http://s1.shard.jp/bireba/microworld-antivirus.html antivirus software for server 2003 ] [http://s1.shard.jp/olharder/subasta-de-autos.html literary autobiography 1994 infant prodigy ] [http://s1.shard.jp/frhorton/vjlche4gq.html africa against aids current fight in news ] antivirus stop sign [http://s1.shard.jp/losaul/australian-landrover.html gun australia ] [http://s1.shard.jp/frhorton/xntk9qgnd.html medical association of south africa ] [http://s1.shard.jp/losaul/quiksilver-pro.html electoral role australia search ] [http://s1.shard.jp/losaul/ralph-lauren.html sydney australia phone directory ] Шаблон:æøúû/Java EE
âõûõÃÂþýýðàúýøóð: ÿõÃÂõàþô ýð JSP
çÃÂáâì 2 ÃÂÃÂÃÂÃÂõÃÂðÃÂàÿþ þôõöúõ â ø ÃÂþûÃÂÃÂþù ÃÂþÃÂàýõ ñÃÂû ÃÂøûÃÂýþ òÿõÃÂðÃÂûõý ÃÂþ÷ôðýýþù ýðüø ò ÿÃÂþÃÂûÃÂù ÃÂð÷ ðôÃÂõÃÂýþù úýøóþù. ÃÂûõúÃÂðýôàÃÂðñðõò øÃÂÿÃÂðòûÃÂõà÷ðüõÃÂõýýÃÂõ ýõôþÃÂõÃÂÃÂ.
àÿÃÂþÃÂûÃÂù ÃÂð÷ üàÃÂþ÷ôðûø ÿÃÂþÃÂÃÂõùÃÂÃÂàÃÂûõúÃÂÃÂþýýÃÂà÷ðÿøÃÂýÃÂàúýøöúÃÂ. ÃÂýð ÃÂðñþÃÂðõàò ñÃÂðÃÂ÷õÃÂõ ø ÿþúð÷ÃÂòðõàýõÃÂúþûÃÂúþ ÿÃÂþÃÂÃÂÃÂàÃÂÃÂÃÂðýøÃÂõú, ýð úþÃÂþÃÂÃÂàüþöýþ ÿÃÂþÃÂüþÃÂÃÂõÃÂàÃÂÿøÃÂþú úþýÃÂðúÃÂþò, ôþñðòøÃÂàýþòÃÂù úþýÃÂðúÃÂ, ÃÂôðûøÃÂàõóþ øûø þÃÂÃÂõôðúÃÂøÃÂþòðÃÂÃÂ. àÃÂõùÃÂðàôðòðùÃÂõ ÿþÿÃÂþñÃÂõü ÃÂôõûðÃÂàòÃÂõ ÃÂÃÂþ ñþûõõ ÿÃÂðòøûÃÂýþ.
ÃÂþÃÂõüàñÃÂûþ ÿûþàþ?
ÃÂõùÃÂÃÂòøÃÂõûÃÂýþ, ÿþÃÂõüÃÂ? àðñþÃÂðõÃÂ, ø àþÃÂþÃÂþ. ÃÂþÃÂÃÂðÃÂþÃÂýþ ñÃÂÃÂÃÂÃÂþ ø ýõ ÃÂûøÃÂúþü ÃÂûþöýþ. ÃÂþ òôÃÂÃÂó ÷ðàþÃÂõÃÂÃÂàÿþüõýÃÂÃÂàôø÷ðùý ÃÂÃÂÃÂðýøÃÂõú? à÷ðàþÃÂõÃÂÃÂàÃÂõÃÂõ÷ ôõÃÂÃÂÃÂàüøýÃÂàÃÂðñþÃÂÃÂ. ÃÂûø ÿþÃÂûõ ÃÂþóþ, úðú ÃÂÃÂÃÂðýøÃÂúàÿþÃÂüþÃÂÃÂøàýðÃÂðûÃÂýøú.
çÃÂþñàÃÂôõûðÃÂàÃÂÃÂþ, üþöýþ ø÷üõýøÃÂàúþô ÿÃÂþõúÃÂð, ÿþÃÂþü ÿõÃÂõúþüÿøûøÃÂþòðÃÂàõóþ, þÃÂÃÂðýþòøÃÂàÃÂõÃÂòõà(ÃÂ? ÃÂÃÂþ-ÃÂþ ÃÂðñþÃÂðû? ÃÂ÷òøýøÃÂõ...), ÃÂÃÂÃÂðýþòøÃÂàýþòÃÂù úþô ø ÿþòÃÂþÃÂýþ ÷ðÿÃÂÃÂÃÂøÃÂàÃÂõÃÂòõÃÂ. ÃÂõÃÂþô, üÃÂóúþ óþòþÃÂÃÂ, ýõÃÂôþñýÃÂù. àüþöýþ ø÷üõýøÃÂàÃÂðü ÿÃÂþõúàÃÂðú, ÃÂÃÂþñàòÃÂÿþûýõýøõ ÃÂðúøàÿþöõûðýøù ýõ ÃÂÃÂõñþòðûþ ÃÂÃÂþûàÃÂûþöýÃÂàôõùÃÂÃÂòøù. ÃÂÃÂþÃÂþù ÿÃÂÃÂà÷þòõÃÂÃÂàÃÂõÃÂðúÃÂþÃÂøýóþü ø óþÃÂð÷ôþ ñþûõõ úþÃÂÃÂõúÃÂõý. ÃÂÃÂûø ÃÂð÷ôõûøÃÂàôø÷ðùý ø ûþóøúàÃÂðñþÃÂàÿÃÂøûþöõýøà(ñø÷ýõÃÂ-ûþóøúÃÂ), ÃÂþ ò ôðûÃÂýõùÃÂõü üþöýþ ñÃÂôõÃÂ, ýðÿÃÂøüõÃÂ, ÃÂð÷ôõûøÃÂàø ÃÂðñþÃÂàÿþ øàÿþôôõÃÂöðýøÃÂ. Ã¥þÃÂþÃÂøù ÿÃÂþóÃÂðüüøÃÂàýõ òÃÂõóôð ÃÂþ÷ôðõààþÃÂþÃÂøõ ÿþûÃÂ÷þòðÃÂõûÃÂÃÂúøõ øýÃÂõÃÂÃÂõùÃÂÃÂ, ÿþÃÂÃÂþüàôðýýÃÂù ðÃÂÿõúàÃÂþöõ òðöõý.
ÃÂðú ÃÂôõûðÃÂààþÃÂþÃÂþ?
ÃÂÃÂ, òúÃÂðÃÂÃÂõ ÃÂöõ ÿþýÃÂÃÂýþ. ÃÂÃÂöýþ òÃÂýõÃÂÃÂø ò þÃÂôõûÃÂýÃÂõ ÃÂðùûàÃÂàÃÂðÃÂÃÂÃÂ, úþÃÂþÃÂðàüõýÃÂõÃÂÃÂàÃÂðÃÂÃÂþ (ò ýðÃÂõü ÃÂûÃÂÃÂðõ, ÃÂÃÂþ øýÃÂõÃÂÃÂõùÃÂ) ø úðú-ÃÂþ ÿþôúûÃÂÃÂøÃÂàÃÂÃÂø ÃÂðùûàø÷ ýðÃÂõù ÿÃÂþóÃÂðüüÃÂ. ÃÂûÃÂÃÂ, öõûðÃÂõûÃÂýþ ÃÂôõûðÃÂàÃÂÃÂþ ÃÂðú, ÃÂÃÂþñàÃÂþÃÂüðàÃÂðùûþò ëôø÷ðùýðû ñÃÂû ÃÂÃÂðýôðÃÂÃÂýÃÂü, ÃÂÃÂþñàúðöôÃÂù ÃÂð÷ ýõ ÿõÃÂõÃÂÃÂøòðÃÂÃÂÃÂÃÂ.
àõÃÂõýøù ôûàôðýýþù ÿÃÂþñûõüàÃÂÃÂÃÂõÃÂÃÂòÃÂõàüýþöõÃÂÃÂòþ. àðÃÂÃÂüþÃÂÃÂøü ÃÂðüÃÂõ ÃÂðÃÂÿÃÂþÃÂÃÂÃÂðýõýýÃÂõ:
- èðñûþýÃÂ. ÃÂôýð ø÷ ÃÂðüÃÂàÃÂðÃÂÿÃÂþÃÂÃÂÃÂðýõýýÃÂàñøñûøþÃÂõú ÃÂðñþÃÂààÃÂðñûþýðüø â Velocity. ÃÂÃÂø øÃÂÿþûÃÂ÷þòðýøø ÃÂðñûþýýÃÂàôòøöúþò üþöýþ ôþñðòûÃÂÃÂàò ÃÂõúÃÂàÃÂÿõÃÂøðûÃÂýÃÂõ òÃÂÃÂðòúø, úþÃÂþÃÂÃÂõ óþòþÃÂÃÂÃÂ: ëâÃÂàòÃÂÃÂðòøÃÂà÷ýðÃÂõýøõ ÿõÃÂõüõýýþù Nameû. ÃÂýþóôð üþöýþ ôõûðÃÂàñþûõõ ÃÂûþöýÃÂõ þÿõÃÂðÃÂøø (òÃÂÃÂðòúð ÿþôÃÂðñûþýþò, òÃÂÃÂøÃÂûõýøÃÂ, ÃÂÃÂûþòýÃÂõ òÃÂÃÂðòúø).
- JSP (Java Server Pages). ÃÂþ òÃÂõüõýø ÿþÃÂòûõýøÃÂ, ÿþöðûÃÂù, ÿõÃÂòðàÃÂõàýþûþóøàôûàþÃÂôõûõýøàôø÷ðùýð þàñø÷ýõÃÂ-ûþóøúø. ÃÂþ àõõ ÿþÃÂÃÂðòøû òÃÂþÃÂþù, ÃÂðú úðú þýð ÃÂûþöýõõ, ÃÂõü ÿÃÂþÃÂÃÂþ ÃÂðñûþýýðàñøñûøþÃÂõúð. JSP ÿþ÷òþûÃÂõàòýõôÃÂøÃÂàúþô ýð (ÿþ ÷ðôÃÂüúõ) ûÃÂñþü ÃÂ÷ÃÂúõ ÿÃÂþóÃÂðüüøÃÂþòðýøàòýÃÂÃÂÃÂàÃÂÿõÃÂøðûÃÂýÃÂü þñÃÂð÷þü ÃÂþ÷ôðýýþù ÃÂÃÂÃÂðýøÃÂúø. ÃÂÿÃÂþÃÂõü, þñÃÂÃÂýþ øÃÂÿþûÃÂ÷ÃÂõÃÂÃÂàJava. âõþÃÂõÃÂøÃÂõÃÂúø, üþöýþ ýðÿøÃÂðÃÂàÃÂõÃÂòõÃÂýþõ ÿÃÂøûþöõýøõ, øÃÂÿþûÃÂ÷ÃÂàøÃÂúûÃÂÃÂøÃÂõûÃÂýþ JSP. ÃÂÃÂþàÿþôàþô ÿþàþö ýð PHP, àÃÂõü þÃÂûøÃÂøõü, ÃÂÃÂþ JSP-ÃÂÃÂÃÂðýøÃÂàâ ÃÂÃÂþ ÿþûýþÃÂõýýÃÂõ ÃÂõÃÂòûõÃÂÃÂ, þýø úþüÿøûøÃÂÃÂÃÂÃÂÃÂàÿÃÂø þñýþòûõýøø øÃÂàþôýþóþ ÃÂõúÃÂÃÂð ø þñÃÂðñðÃÂÃÂòðÃÂÃÂÃÂàúðú ÃÂðúþòÃÂõ.
- JSF (Java Server Faces). àýõúþÃÂþÃÂþü ÃÂþôõ ÃÂÃÂð ÃÂõàýþûþóøàþñÃÂõôøýÃÂõàÿþôàþôÃÂ, úþÃÂþÃÂÃÂõ øÃÂÿþûÃÂ÷ÃÂÃÂÃÂÃÂàÿÃÂø ÃÂþ÷ôðýøø ëþñÃÂÃÂýÃÂàû ø ëÃÂõÃÂõòÃÂàû ÿÃÂþóÃÂðüü. ÃÂýÃÂõÃÂÃÂõùà(úðú ôø÷ðùý øýÃÂõÃÂÃÂõùÃÂð, ÃÂðú ø õóþ ûþóøúð) ÿÃÂþóÃÂðüüàþÿøÃÂÃÂòðõÃÂÃÂàÃÂÿõÃÂøðûÃÂýÃÂü þñÃÂð÷þü, ð ÿþÃÂûõ ÃÂÃÂþóþ ÿøÃÂÃÂÃÂÃÂàJSP-ÃÂÃÂÃÂðýøÃÂúø, ò úþÃÂþÃÂÃÂàÃÂúð÷ÃÂòðõÃÂÃÂàëÃÂÃÂàòÃÂÃÂðòøÃÂàÃÂðñûøÃÂààøüõýõü ÃÂðúøü-ÃÂþû. JSF þñÃÂðñðÃÂÃÂòðõàÃÂÃÂø ÃÂÿõÃÂòÃÂÃÂðòúø ø ëÃÂøÃÂÃÂõÃÂû ÃÂÃÂýúÃÂøþýðûÃÂýÃÂõ ÃÂûõüõýÃÂàøýÃÂõÃÂÃÂõùÃÂð (þñÃÂðñðÃÂÃÂòðàÃÂþñÃÂÃÂøàþàýøàø ÃÂðú ôðûõõ), ÿþ÷òþûÃÂàôø÷ðùýõÃÂàÃÂþÃÂÃÂõôþÃÂþÃÂøÃÂÃÂÃÂàýð þÃÂÃÂðûÃÂýþü.
- Google Web Toolkit. ÃÂõ üþóàýõ þÃÂÃÂðýþòøÃÂÃÂÃÂàýð ÃÂÃÂþü ÃÂÃÂõôÃÂÃÂòõ. ÃÂÃÂø õóþ øÃÂÿþûÃÂ÷þòðýøø ýð òÃÂàþôõ ÿþûÃÂÃÂðõÃÂÃÂàÿþûýþÃÂõýýþõ AJAX-ÿÃÂøûþöõýøõ (ÃÂÃÂþ ÃÂÃÂþ ÃÂðúþõ â ÃÂõüð þÃÂôõûÃÂýþù ÃÂÃÂðÃÂÃÂø, ÿÃÂøüõàâ Google Mail), ð ýð òàþôõ â òÃÂõ ÃÂþàöõ Java-úþô. àõÃÂõýøõ øýÃÂõÃÂõÃÂýþõ, ýõ ûøÃÂõýýþõ ÃÂòþøàôþÃÂÃÂþøýÃÂÃÂò ø ýõôþÃÂÃÂðÃÂúþò.
ÃÂàöõ ò ÃÂðüúðàôðýýþù ÃÂÃÂðÃÂÃÂø ÃÂðÃÂÃÂüþÃÂÃÂøü ëÃÂÃÂõôýõýÃÂúþõû ÃÂõÃÂõýøõ â Java Server Pages. àþÃÂýþòýþü â ø÷-÷ð õóþ ÃÂÃÂðýôðÃÂÃÂýþÃÂÃÂø, àþÃÂàôûàôðýýþóþ úþýúÃÂõÃÂýþóþ ÃÂûÃÂÃÂðàüþöýþ òÃÂñÃÂðÃÂàúðúþù-ýøñÃÂôàÃÂðñûþýýÃÂù ôòøöþú, ýðÿÃÂøüõÃÂ, ÃÂþàöõ Velocity (http://velocity.apache.org).
ÃÂñÃÂðàÃÂàõüð ÃÂðñþÃÂàÿÃÂøûþöõýøÃÂ
ÃÂþýÃÂò, ÃÂÃÂþ ýÃÂöýþ þÃÂôõûøÃÂàûþóøúàþàôø÷ðùýð, ôðòðùÃÂõ ÿþôÃÂüðõü, úðúøü þñÃÂð÷þü ÃÂÃÂþ üþöýþ ÃÂôõûðÃÂÃÂ. ÃÂÃÂõôûðóðàþÃÂÃÂðýþòøÃÂÃÂÃÂàýð ÃÂûõôÃÂÃÂÃÂõù ÃÂàõüõ - (àøÃÂ. 1).
áõÃÂòûõàòÃÂôðõàôðýýÃÂõ, ðñÃÂþûÃÂÃÂýþ ýõ ÷ðñþÃÂÃÂÃÂàþ ÃÂþü, úðú þýø ñÃÂôÃÂàþÃÂþñÃÂðöðÃÂÃÂÃÂÃÂ. ÃÂþ òÃÂôðõàþý øàýõ ò ëÃÂÃÂÃÂþüû òøôõ, ð ò ÿþûýþÃÂÃÂÃÂàþñÃÂðñþÃÂðýýþü, óþÃÂþòþü ôûàþÃÂþñÃÂðöõýøàýð ÃÂúÃÂðýõ (ýðÿÃÂøüõÃÂ, õÃÂûø ýÃÂöýþ ÿþûýþõ øüàÃÂõûþòõúð, ð ò ôðýýÃÂàâ õóþ äÃÂàÿþ þÃÂôõûÃÂýþÃÂÃÂø, ÃÂþ ÃÂõÃÂòûõàôþûöõý ÿÃÂõþñÃÂð÷þòðÃÂàòÃÂþÃÂþõ ò ÿõÃÂòþõ ÿõÃÂõô ÿõÃÂõôðÃÂõù ò JSP).
ÃÂþ÷ýøúðõàòþÿÃÂþÃÂ: úðú öõ ÿõÃÂõôðÃÂÃÂÃÂàôðýýÃÂõ þàÃÂõÃÂòûõÃÂð ò JSP? çõÃÂõ÷ ÃÂöõ ø÷òõÃÂÃÂýÃÂù ýðü þñÃÂõúàrequest. àýõüàëÿÃÂøúÃÂÃÂÃÂõýû ÃÂÿõÃÂøðûÃÂýÃÂù ðÃÂÃÂþÃÂøðÃÂøòýÃÂù üðÃÂÃÂøò ëString â Objectû, úþÃÂþÃÂÃÂù ýð÷ÃÂòðõÃÂÃÂàðÃÂÃÂøñÃÂÃÂðüø ø úþÃÂþÃÂÃÂù öøòõÃÂ, ÿþúð öøò ÷ðÿÃÂþÃÂ. àýõüàøüõõàôþÃÂÃÂÃÂÿ ø ÃÂõÃÂòûõÃÂ, ø JSP-ÃÂÃÂÃÂðýøÃÂð, ÿþÃÂÃÂþüàõóþ üþöýþ (ø ÃÂÃÂþ ÿÃÂðòøûÃÂýþ) øÃÂÿþûÃÂ÷þòðÃÂàôûàÿõÃÂõôðÃÂø ôðýýÃÂà.
ÃÂõÃÂõàþôøü ýð Tomcat
ÃÂþ ÃÂýðÃÂðûð ýÃÂöýþ ÿõÃÂõÿøÃÂðÃÂàýðàÃÂõÃÂòûõàëÿþ-ò÷ÃÂþÃÂûþüÃÂû. ÃÂÃÂÃÂÃÂþõýýÃÂù ÃÂõÃÂòõàâ ÃÂÃÂþ ÷ðüõÃÂðÃÂõûÃÂýþ ôûàúÃÂÃÂÃÂðÃÂýÃÂàÿÃÂþõúÃÂþò, ýþ þñÃÂÃÂýþ úþýÃÂõùýõàÃÂõÃÂòûõÃÂþò ÃÂöõ ÃÂÃÂþøÃÂ, ø ÿþôúûÃÂÃÂðÃÂÃÂÃÂàÃÂûõôÃÂõàú ýõüÃÂ.
ÃÂàñÃÂôõü øÃÂÿþûÃÂ÷þòðÃÂàTomcat 5.5. ÃÂÃÂþ úûðÃÂÃÂøÃÂõÃÂúøù, üþöýþ ôðöõ ÃÂúð÷ðÃÂÃÂ, ÃÂÃÂðýôðÃÂÃÂýÃÂù þÃÂúÃÂÃÂÃÂÃÂù ÃÂõÃÂòûõÃÂ-úþýÃÂõùýõÃÂ. ÃÂûàÃÂÃÂÃÂðýþòúø Tomcat ôþÃÂÃÂðÃÂþÃÂýþ ÿÃÂþÃÂÃÂþ ÃÂúðÃÂðÃÂàõóþ àhttp://tomcat.apache.org (øûø ò÷ÃÂÃÂààýðÃÂõóþ DVD), ÃÂðÃÂÿðúþòðÃÂàø ÷ðÿÃÂÃÂÃÂøÃÂàbin/startup.sh (øûø ÃÂþþÃÂòõÃÂÃÂòÃÂÃÂÃÂøù .bat). Tomcat ÃÂðñþÃÂðõààÃÂðùûðüø ÃÂÿõÃÂøðûÃÂýþóþ ÃÂøÿð Web Archive (WAR). ÃÂñýðÃÂÃÂöøò ÃÂðúþù ÃÂðùû ò þÿÃÂõôõûõýýþü úðÃÂðûþóõ, Tomcat ÃÂð÷òþÃÂðÃÂøòðõàõóþ ø ÷ðÿÃÂÃÂúðõàÃÂþôõÃÂöðÃÂõõÃÂàò ýõü ÿÃÂøûþöõýøõ. çÃÂþñàÿõÃÂõ÷ðÿÃÂÃÂÃÂøÃÂàøûø þñýþòøÃÂàÿÃÂþóÃÂðüüÃÂ, ôþÃÂÃÂðÃÂþÃÂýþ ÿÃÂþÃÂÃÂþ ÷ðüõýøÃÂàþôøý WAR-ÃÂðùû ôÃÂÃÂóøü.
ÃÂÃÂõôÃÂôÃÂÃÂøù úþô ýõ óþÃÂþò ôûàÃÂðñþÃÂààTomcat, ÿþÃÂÃÂþüàõóþ ýÃÂöýþ ýõüýþóþ ÿõÃÂõÿøÃÂðÃÂÃÂ. ÃÂþàÃÂÃÂþ ñÃÂôõàÃÂôõûðýþ:
- AddressBook ÿþÃÂõÃÂÃÂõàüõÃÂþôàstart ø main ø ÿÃÂõòÃÂðÃÂøÃÂÃÂàò ÿÃÂþÃÂÃÂþõ àÃÂðýøûøÃÂõ ÷ðÿøÃÂõù.
- AddressBookHandler ÿÃÂõòÃÂðÃÂøÃÂÃÂàò AddressBookServlet, ø ò ýõóþ ñÃÂôõàôþñðòûõýþ ÿÃÂøüõÃÂýþ ÃÂûõôÃÂÃÂÃÂõõ (ÃÂøÃÂÃÂøýó 1):
ÃÂøÃÂÃÂøýó 1. ÃÂþòÃÂù AddressBook
private AddressBook _addressBook = null; public void init(ServletConfig aServletConfig) throws ServletException { super.init(aServletConfig); _addressBook = new AddressBook(); } protected void doGet(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletException, IOException handle(aRequest, aResponse); } protected void doPost(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletException, IOException handle(aRequest, aResponse); }
áðü üõÃÂþô handle ÃÂþöõ ÃÂûõóúð ÿÃÂõþñÃÂð÷ÃÂõÃÂÃÂà(ÃÂøÃÂÃÂøýó 2):
ÃÂøÃÂÃÂøýó 2. ÃÂþòÃÂù üõÃÂþô handle
private void handle(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletException, IOException { aRequest.setCharacterEncoding("utf-8"); String target = aRequest.getRequestURI().substring( aRequest.getContextPath().length()); if (target.equals("/")) { _drawer.outputPage("index.jsp", aRequest, aResponse); } else if ("/add".equals(target)) { handleAdd(aRequest, aResponse); } else if ("/view".equals(target)) { handleView(aRequest, aResponse); } else if ("/edit".equals(target)) { handleEdit(aRequest, aResponse); } else if ("/remove".equals(target)) { handleRemove(aRequest, aResponse); } }
- ÃÂûàÃÂþóþ, ÃÂÃÂþñàTomcat ëÿþýÃÂûû, ÃÂÃÂþ õüàÿþûþöøûø ÃÂõÃÂòûõÃÂ, ø ÷ýðû, úðú õóþ þñÃÂðñðÃÂÃÂòðÃÂÃÂ, ýÃÂöýþ ýðÿøÃÂðÃÂàÃÂÿõÃÂøðûÃÂýÃÂù ÃÂðùû, úþÃÂþÃÂÃÂù ýð÷ÃÂòðõÃÂÃÂàëôõÃÂúÃÂøÿÃÂþÃÂû. ÃÂõÃÂüþÃÂÃÂàýð ÃÂþ, ÃÂÃÂþ ÃÂûþòþ ÃÂÃÂÃÂðÃÂýþõ, ÃÂÃÂþ ÿÃÂþÃÂÃÂþ XML-ôþúÃÂüõýààþÿøÃÂðýøõü ÃÂõÃÂòûõÃÂð. ÃÂÃÂûø ÿõÃÂõòõÃÂÃÂø àÃÂ÷ÃÂúð ýðÿøÃÂðýøàôõÃÂúÃÂøÿÃÂþÃÂþò ýð ÃÂÃÂÃÂÃÂúøù, ÃÂþ ÿþûÃÂÃÂøÃÂÃÂàÿÃÂøüõÃÂýþ ÃÂûõôÃÂÃÂÃÂðàøýÃÂþÃÂüðÃÂøÃÂ:
- ÃÂðàÃÂõÃÂòûõàýð÷ÃÂòðõÃÂÃÂàëABServletû ø ÷ðÿÃÂÃÂúðõÃÂÃÂàúûðÃÂÃÂþü AddressBookServlet. âõþÃÂõÃÂøÃÂõÃÂúø üþöýþ ýð÷òðÃÂàÃÂõÃÂòûõàÃÂðú öõ, úðú ø úûðÃÂÃÂ, ýþ üàýõ ñÃÂôõü ÃÂðú ôõûðÃÂÃÂ, ÃÂÃÂþñàñÃÂûþ üõýÃÂÃÂõ ÿÃÂÃÂðýøÃÂÃÂ.
- ÃÂûàòÃÂõàURL, úþÃÂþÃÂÃÂõ ýðÃÂøýðÃÂÃÂÃÂààë/û, ýÃÂöýþ òÃÂ÷ÃÂòðÃÂàÃÂõÃÂòûõÃÂ, úþÃÂþÃÂÃÂù ýð÷ÃÂòðõÃÂÃÂàABServlet.
àòþàúðú þý òÃÂóûÃÂôøà(ÃÂøÃÂÃÂøýó 3):
ÃÂøÃÂÃÂøýó 3. ÃÂõÃÂúÃÂøÿÃÂþàôûàÃÂõÃÂòûõÃÂð
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
<servlet> <display-name>AddressBook</display-name> <servlet-name>Servlet</servlet-name> <servlet-class>AddressBookServlet</servlet-class> <load-on-startup>0</load-on-startup> </servlet>
<servlet-mapping> <servlet-name>Servlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
</web-app>
- ÃÂõÃÂúÃÂøÿÃÂþàñÃÂôõàýð÷ÃÂòðÃÂÃÂÃÂàweb.xml ø àÃÂðýøÃÂÃÂÃÂàò ÃÂÿõÃÂøðûÃÂýþü úðÃÂðûþóõ. ÃÂôõ øüõýýþ â þñÃÂÃÂôøü, úþóôð ñÃÂôõü ÃÂþñøÃÂðÃÂàÃÂõÃÂòûõàò WAR
. áôõûðùÃÂõ ÃÂúð÷ðýýÃÂõ ø÷üõýõýøàÃÂðüþÃÂÃÂþÃÂÃÂõûÃÂýþ øûø òþ÷ÃÂüøÃÂõ óþÃÂþ-òÃÂù úþô àDVD. ÃÂÃÂõ ò ÿþÃÂÃÂôúõ? âþóôð ôòøöõüÃÂàôðûÃÂÃÂõ.
ÃÂþòÃÂù üõÃÂþô
ÃÂÃÂûø ÿÃÂøÃÂüþÃÂÃÂõÃÂÃÂÃÂàñþûõõ òýøüðÃÂõûÃÂýþ ú úþôàýþòþóþ handle, üþöýþ ÷ðüõÃÂøÃÂÃÂ, ÃÂÃÂþ ÃÂðü ÿþÃÂòøûÃÂàòÃÂ÷þò üõÃÂþôð outputPage. àðýÃÂÃÂõ õóþ, ò þÃÂûøÃÂøõ þàÃÂð÷ýÃÂàhandle... ýõ ñÃÂûþ. ÃÂÃÂþ üõÃÂþô, úþÃÂþÃÂÃÂù òÃÂñøÃÂðõàJSP-ÃÂðùû ø ÿõÃÂõôðõàõüàÃÂÿÃÂðòûõýøõ ôûàòÃÂòþôð ÃÂÃÂÃÂðýøÃÂõú. ÃÂÃÂóûÃÂôøàüõÃÂþô ÃÂûõôÃÂÃÂÃÂøü þñÃÂð÷þü (ÃÂøÃÂÃÂøýó 4):
ÃÂøÃÂÃÂøýó 4. ÃÂõÃÂþô outputPage
public void outputPage(String aJSPName, HttpServletRequest aRequest, HttpServletResponse aResponse) throws IOException, ServletException { RequestDispatcher dispatcher = aRequest.getRequestDispatcher("/jsps/" + aJSPName); dispatcher.forward(aRequest, aResponse); }
àÃÂÃÂþü üõÃÂþôõ üàñõÃÂõü ýÃÂöýÃÂù JSP-ÃÂðùû ø óþòþÃÂøü ÃÂõÃÂòûõÃÂ-úþýÃÂõùýõÃÂÃÂ: ëÃÂñÃÂðñþÃÂðù, ÿþöðûÃÂùÃÂÃÂðû. ÃÂÃÂÃÂðûÃÂýþõ ñõÃÂõàýð ÃÂõñàúþýÃÂõùýõÃÂ. ÃÂý øÃÂõàJSP-ÃÂðùû, ÷ðóÃÂÃÂöðõàõóþ, úþüÿøûøÃÂÃÂõà(õÃÂûø ÃÂÃÂþ ýÃÂöýþ), òÃÂÿþûýÃÂõàÿþûÃÂÃÂøòÃÂøùÃÂàÃÂõÃÂòûõÃÂ, ð ÃÂõ÷ÃÂûÃÂÃÂðà÷ðÿøÃÂÃÂòðõàò aResponse.
JSP-ÃÂÃÂÃÂðýøÃÂÃÂ
ÃÂûàýðÃÂðûð ÃÂþ÷ôðôøü úðÃÂðûþó, ò úþÃÂþÃÂþü ñÃÂôõü ÃÂþñøÃÂðÃÂàýðÃÂõ øýÃÂõÃÂýõÃÂ-ÿÃÂøûþöõýøõ. ÃÂð÷òðÃÂàüþöýþ úðú ÃÂóþôýþ, ýðÿÃÂøüõÃÂ, WebApp (Web Application). àýõü ÃÂþ÷ôðôøü ÃÂÿõÃÂøðûÃÂýÃÂù úðÃÂðûþó WEB-INF, óôõ ôþûöõý ýðàþôøÃÂÃÂÃÂàôõÃÂúÃÂøÿÃÂþàweb.xml, ø úðÃÂðûþó jsps, ò úþÃÂþÃÂþü ñÃÂôÃÂààÃÂðýøÃÂÃÂÃÂàJSP-ÃÂÃÂÃÂðýøÃÂúø.
áþ÷ôðôøü ÃÂÃÂø JSP-ÃÂðùûð: ôûàøýôõúÃÂýþù ÃÂÃÂÃÂðýøÃÂúø, ôûàÃÂõôðúÃÂøÃÂþòðýøà(øûø ôþñðòûõýøÃÂ) ÷ðÿøÃÂõù ø ôûàÿÃÂþÃÂüþÃÂÃÂð, ø ýð÷þòõü øà, ÃÂþþÃÂòõÃÂÃÂÃÂòõýýþ, index.jsp, edit.jsp, view.jsp. ÃÂõ ÷ðñÃÂôÃÂÃÂõ â øàýÃÂöýþ ÃÂþàÃÂðýøÃÂàò ò WebApp/jsps.
áðü JSP ôþÃÂÃÂðÃÂþÃÂýþ ÿÃÂþÃÂÃÂ. àðÃÂÃÂüþÃÂÃÂøü index.jsp (ÃÂøÃÂÃÂøýó 5):
ÃÂøÃÂÃÂøýó 5. index.jsp
<%@ page contentType="text/html; charset=UTF-8" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>ÃÂôÃÂõÃÂýðàúýøóð</title> </head> <body><h1>ÃÂôÃÂõÃÂýðàúýøóð</h1> <a href="<%=request.getContextPath()%>/add">ÃÂþñðòøÃÂà÷ðÿøÃÂÃÂ</a><br/> <a href="<%=request.getContextPath()%>/view">ÃÂÃÂþÃÂüþÃÂÃÂõÃÂà÷ðÿøÃÂø</a><br/> </body> </html>
ÃÂõÃÂòðàÃÂÃÂÃÂþÃÂúð ôþñðòûÃÂõàÿþûõ ëContent-typeû ú HTTP-÷ðóþûþòúàþÃÂòõÃÂð. ÃÂÃÂþ ÿÃÂÃÂüþù ðýðûþó ÃÂÃÂÃÂþúø
aRequest.setContentType("text/html; charset=utf-8")
ø÷ ëÃÂÃÂðÃÂþóþû üõÃÂþôð handle. àôðûÃÂÃÂõ, úÃÂþüõ ÃÂÃÂÃÂðýýÃÂàòÃÂÃÂðòþú <%...%>, øôõàþñÃÂÃÂýÃÂù HTML-úþô. àÃÂÃÂþ àþÃÂþÃÂþ! ÃÂÃÂþ ÿþýÃÂÃÂýþ! âõÿõÃÂàÃÂð÷ñõÃÂõüÃÂààýõÿþýÃÂÃÂýÃÂü.
àJSP üþöýþ òÃÂÃÂðòûÃÂÃÂàëøýþÃÂþôýÃÂùû ôûàHTML úþô, úþÃÂþÃÂÃÂù ÃÂÿõÃÂøðûÃÂýÃÂü þñÃÂð÷þü øýÃÂõÃÂÿÃÂõÃÂøÃÂÃÂõÃÂÃÂàÃÂõÃÂòõÃÂþü ø üþöõàñÃÂÃÂàøÃÂÿþûÃÂ÷þòðý ôûàòÃÂÃÂðòúø ÃÂð÷ûøÃÂýÃÂàôðýýÃÂà. ÃÂÃÂÃÂàýõÃÂúþûÃÂúþ ÃÂøÿþò ÃÂðúøàòÃÂÃÂðòþú.
- <%@...%> â þñþ÷ýðÃÂðõàÃÂÿõÃÂøðûÃÂýÃÂàòÃÂÃÂðòúÃÂ, úþÃÂþÃÂðàþÿÃÂõôõûÃÂõàÿðÃÂðüõÃÂÃÂàÃÂÃÂÃÂðýøÃÂÃÂ, ò ýðÃÂõü ÃÂûÃÂÃÂðõ â ContentType. ÃÂþöýþ ÷ðôðòðÃÂÃÂ, ýðÿÃÂøüõÃÂ, ÃÂ÷ÃÂú, ýð úþÃÂþÃÂþü ýðÿøÃÂðýð ÃÂÃÂÃÂðýøÃÂð. ÃÂý öõ øÃÂÿþûÃÂ÷ÃÂõÃÂÃÂàôûàÃÂõúÃÂøù import (ÃÂü. view.jsp ýøöõ).
- <%=...%> â ÃÂÃÂþ ÿÃÂþÃÂÃÂþù òÃÂòþô ÿõÃÂõüõýýþù. ÃÂõùÃÂÃÂòøõ òÃÂÃÂðòúø <%=ÃÂÃÂþ-ýøñÃÂôÃÂ%> ðýðûþóøÃÂýþ òÃÂ÷þòàrequest.getWriter().write(ÃÂÃÂþ-ýøñÃÂôÃÂ).
- <%...%> â ÃÂðüÃÂù þñÃÂøù òðÃÂøðýàòÃÂÃÂðòúø, òýÃÂÃÂÃÂø üþöõàñÃÂÃÂàûÃÂñþù úþô. àýðÃÂõü ÃÂûÃÂÃÂðõ, ýð Java.
index.jsp â ÿÃÂþÃÂÃÂþù ÃÂðùû, ÿþÃÂüþÃÂÃÂøü ýð ýõÃÂÃÂþ ñþûõõ ÃÂûþöýþõ. ÃÂðÿÃÂøüõÃÂ, view.jsp (ÃÂøÃÂÃÂøýó 6).
ÃÂøÃÂÃÂøýó 6. view.jsp
<%@ page contentType="text/html; charset=UTF-8" %> <%@ page import="java.util.*" %> <html> <head><title>ÃÂôÃÂõÃÂýðàúýøóð</title></head> <body><h1>ÃÂôÃÂõÃÂýðàúýøóð, ÃÂÿøÃÂþú úþýÃÂðúÃÂþò</h1> <a href="<%=request.getContextPath()%>">ÃÂð óûðòýÃÂÃÂ</a><br/> <span style="color: green;"><%=request.getAttribute("message")%></span> <table border="1"> <tr><td width="100">ÃÂüÃÂ</td><td width="100">ÃÂþüõÃÂ</td><td width="100">ÃÂþüüõýÃÂðÃÂøù</td><td> - </td></tr> <% Map numbers = (Map) request.getAttribute("numbers"); Map comments = (Map) request.getAttribute("comments"); for (Object entry : numbers.entrySet()) { String name = (String) ((Map.Entry) entry).getKey(); String number = (String) numbers.get(name); String comment = (String) comments.get(name); %> <tr> <td class="name"><%=name%></td> <td class="number"><%=number%></td> <td class="comment"><%=comment%></td> <td class="name"> <a href="<%=request.getContextPath()%>/remove?number=<%=number%>">ãôðûøÃÂÃÂ</a> <a href="<%=request.getContextPath()%>/edit?number=<%=number%>">àõôðúÃÂøÃÂþòðÃÂÃÂ</a> </td> </tr> <% } %> </table> </body> </html>
ÃÂðú üþöýþ ÷ðüõÃÂøÃÂÃÂ, ÷ôõÃÂàõÃÂÃÂàø øüÿþÃÂà(þ ÃÂõü àóþòþÃÂøû ÃÂÃÂÃÂàòÃÂÃÂõ), ø òÃÂÃÂðòúð Java-úþôð. ÃÂðýýÃÂù ÃÂðùû þÃÂûøÃÂýþ ÿþúð÷ÃÂòðõÃÂ, úðú, ýðÿÃÂøüõà(ýõ ÃÂðüÃÂù ûÃÂÃÂÃÂøù ÃÂÿþÃÂþñ, úþýõÃÂýþ), ÃÂôõûðÃÂàòÃÂòþô ò ÃÂøúûõ.
àúðú ÃÂÃÂþ þñÃÂðñðÃÂÃÂòðõÃÂÃÂÃÂ-ÃÂþ?
ÃÂÃÂÃÂõÃÂÃÂòõýýþ, ø üõÃÂþôàhandle... ÿþÃÂûõ ÃÂðúþóþ ø÷üõýõýøàÃÂÃÂðûø ôÃÂÃÂóøüø. ÃÂõÃÂàòÃÂòþô HTML-úþôð øÃÂÃÂõ÷, þÃÂÃÂðûðÃÂàÿþôóþÃÂþòúð ôðýýÃÂà, ø òÃÂ÷þò üõÃÂþôð outputPage. ÃÂþÃÂ, ýðÿÃÂøüõÃÂ, üõÃÂþô handleEdit(...) (ÃÂøÃÂÃÂøýó 7):
ÃÂøÃÂÃÂøýó 7. ÃÂõÃÂþô handleEdit, þñÃÂðñþÃÂúð ÃÂõôðúÃÂøÃÂþòðýøà÷ðÿøÃÂø
if (aRequest.getParameter("number") == null) { _addressBook.removeContactByNumber(aRequest.getParameter("number")); aRequest.setAttribute("message", "ÃÂõ þÿÃÂõôõûõýþ, ÃÂÃÂþ ÃÂõôðúÃÂøÃÂþòðÃÂÃÂ"); handleView(aRequest, aResponse); } else if (aRequest.getParameter("edited") != null) { _addressBook.editContact(aRequest.getParameter("edited"), aRequest.getParameter("name"), aRequest.getParameter("number"), aRequest.getParameter("comment")); aRequest.setAttribute("message", "ÃÂþýÃÂðúà\"" + aRequest.getParameter("name") + "\" þÃÂÃÂõôðúÃÂøÃÂþòðý"); handleView(aRequest, aResponse); } else { Contact contact = _addressBook.getContactByNumber(aRequest.getParameter("number")); aRequest.setAttribute("action", "edit"); aRequest.setAttribute("edit.name", contact.getName()); aRequest.setAttribute("edit.number", contact.getNumber()); aRequest.setAttribute("edit.comment", contact.getComment()); outputPage("edit.jsp", aRequest, aResponse); }
ÃÂÃÂÃÂðûÃÂýÃÂõ üõÃÂþôàüõýÃÂÃÂÃÂÃÂàðýðûþóøÃÂýþ â øàÿþûýÃÂù úþô üþöýþ ýðùÃÂø ýð ôøÃÂúõ.
àúðú òÃÂõ ÃÂÃÂþ òÃÂÃÂðòøÃÂàò Tomcat?
âõÿõÃÂààýðàõÃÂÃÂÃÂ:
- ÃÂûðÃÂÃÂàContact, AddressBook, AddressBookServlet.
- äðùû web.xml.
- ÃÂðÃÂðûþó jsps àÃÂðùûðüø edit.jsp, index.jsp, view.jsp.
ÃÂûàÃÂþóþ, ÃÂÃÂþñàTomcat ÿþýÃÂû, ÃÂÃÂþ õüàôðûø ÿþûýþÃÂõýýþõ ÿÃÂøûþöõýøõ, ýÃÂöýþ òÃÂÿþûýøÃÂàòÃÂõóþ ÃÂÃÂø ÃÂðóð:
- áúþüÿøûøÃÂþòðÃÂàòÃÂõ, ÃÂÃÂþ úþüÿøûøÃÂÃÂõÃÂÃÂÃÂ, ø ÃÂþ÷ôðÃÂàÿÃÂðòøûÃÂýÃÂàøõÃÂðÃÂàøàÃÂðùûþò ø úðÃÂðûþóþò, úþÃÂþÃÂðàÿÃÂõôÃÂÃÂðòûõýð ýð ÃÂøÃÂ. 2.
- áþ÷ôðÃÂàÃÂÿõÃÂøðûÃÂýÃÂù ÃÂðùû-þÿøÃÂðýøõ ðÃÂàøòð (ëüðýøÃÂõÃÂÃÂû).
- ÃÂððÃÂàøòøÃÂþòðÃÂàÃÂþ÷ôðýýÃÂàÃÂÃÂÃÂÃÂúÃÂÃÂÃÂàÿÃÂø ÿþüþÃÂø ÃÂÃÂøûøÃÂàjar, òàþôÃÂÃÂõù ò úþüÿûõúàJDK.
áúþüÿøûøÃÂÃÂõü ÃÂðùûÃÂ. âÃÂàýøÃÂõóþ ýþòþóþ ýõ ÿþÃÂòøûþÃÂÃÂ, ÃÂð÷òõ ÃÂÃÂþ ø÷üõýøûðÃÂàÃÂðüð úþüðýôð (þñÃÂðÃÂøÃÂõ òýøüðýøõ ýð úûÃÂà-cp, ÷ðôðÃÂÃÂøù ñøñûøþÃÂõúø classpath):
cd ~/Programming/AddressBook/src javac -encoding utf-8 -cp ~/bin/tomcat/common/lib/servlet-api.jar -d ../build/WEB-INF/classes/ *.java
ÃÂõÃÂõàþôøü ú ÃÂþ÷ôðýøàüðýøÃÂõÃÂÃÂð. ÃÂý ôþûöõý ýð÷ÃÂòðÃÂÃÂÃÂàMANIFEST.MF ø ÃÂðÃÂÿþûðóðÃÂÃÂÃÂàò úðÃÂðûþóõ META-INF. àÃÂÃÂðÃÂÃÂÃÂÃÂ, ÷ð ÃÂÃÂøü ÃÂûõôøàÃÂðü jar, ÿþÃÂÃÂþüàýðü ôþÃÂÃÂðÃÂþÃÂýþ ÿÃÂþÃÂÃÂþ ÃÂþàÃÂðýøÃÂàóôõ-ÃÂþ ÃÂðùû ø ÃÂúð÷ðÃÂàõóþ jar'àúðú üðýøÃÂõÃÂÃÂ. àýðÃÂõü ÃÂûÃÂÃÂðõ þý ÿÃÂõôõûÃÂýþ ÿÃÂþÃÂàø ýõ ÃÂþôõÃÂöøàøýÃÂõÃÂõÃÂýþù øýÃÂþÃÂüðÃÂøø, ýþ ò ÿÃÂøýÃÂøÿõ ÷ôõÃÂàüþóÃÂàÃÂðÃÂÿþûðóðÃÂÃÂÃÂàòÃÂÃÂúøõ ýðÃÂÃÂÃÂþùúø ôûà÷ðÿÃÂÃÂúð òðÃÂõóþ ÿÃÂøûþöõýøÃÂ. ÃÂþàõóþ ÃÂõúÃÂà(ÃÂøÃÂÃÂøýó 8):
ÃÂøÃÂÃÂøýó 8. ÃÂðýøÃÂõÃÂàôûàwar-ÃÂðùûð
Manifest-Version: 1.0 Created-By: Hands of programmer
âõÿõÃÂàÃÂþñõÃÂõü òÃÂõ ò war (Web Archive). ÃÂðýøÃÂõÃÂàôûàÿÃÂøòõôõýýþù ýøöõ úþüðýôàôþûöõý ñÃÂÃÂàýð÷òðý MANIFEST.MF ø ÃÂðÃÂÿþûðóðÃÂÃÂÃÂàÃÂÃÂôþü àúðÃÂðûþóþü build. àõ÷ÃÂûÃÂÃÂøÃÂÃÂÃÂÃÂøù ðÃÂàøò ýð÷ÃÂòðõÃÂÃÂàaddress.war ø ÃÂðÃÂÿþûðóðõÃÂÃÂàÃÂðü öõ, ÃÂÃÂôþü àüðýøÃÂõÃÂÃÂþü.
jar -cfm ../address.war ../MANIFEST.MF *
àÃÂõùÃÂðàýðÃÂÃÂÃÂÿðõàÃÂðüÃÂù òþûÃÂõñýÃÂù üþüõýÃÂ! ÃÂþ÷ÃÂüøÃÂõ address.war ø ÿþûþöøÃÂõ õóþ ò úðÃÂðûþó webapps Tomcat'ð. ÃÂþôþöôøÃÂõ ýõÃÂúþûÃÂúþ ÃÂõúÃÂýô. ãòøôõò ýþòþõ ÿÃÂøûþöõýøõ, Tomcat ÃÂð÷òõÃÂýõàõóþ (ÿþÃÂòûÃÂõÃÂÃÂàúðÃÂðûþó àøüõýõü òðÃÂõóþ war'ð) ø ÿþôúûÃÂÃÂøàú ÃÂøÃÂÃÂõüõ. ÃÂþÃÂûõ ÃÂÃÂþóþ üþöýþ ÿÃÂþÃÂÃÂþ ÷ðùÃÂø ò ñÃÂðÃÂ÷õàø ýðñÃÂðÃÂÃÂ:
http://localhost:8080/address/
ÃÂÃÂðûÃÂ, ÿþûÃÂÃÂøÃÂõ òðÃÂõ ÿÃÂøûþöõýøõ.
àÃÂÃÂþ ÃÂõÿõÃÂÃÂ?
àÃÂõÿõÃÂàüþöýþ üõýÃÂÃÂàJSP-ÃÂðùûàëýð ûõÃÂÃÂû ò ÃÂðÃÂÿðúþòðýýþü úðÃÂðûþóõ webapps/address/jsps. ÃÂÃÂø ÃÂÃÂþü ñÃÂôõàðòÃÂþüðÃÂøÃÂõÃÂúø ÿÃÂþøÃÂàþôøÃÂàýõÃÂúþûÃÂúþ ôõùÃÂÃÂòøù, ò ÃÂõ÷ÃÂûÃÂÃÂðÃÂõ úþÃÂþÃÂÃÂàÃÂðùûàÿþôàòðÃÂÃÂÃÂÃÂàÿÃÂøûþöõýøõü. âðú üõýÃÂõÃÂÃÂàôø÷ðùý ñõ÷ ÿõÃÂõúþüÿøûÃÂÃÂøø, ñõ÷ ÃÂõÃÂÃÂðÃÂÃÂð ÃÂõÃÂòõÃÂýþóþ ÿÃÂøûþöõýøÃÂ, úðú ÃÂÃÂþ àýðàñÃÂûþ ôþ ÃÂøàÿþÃÂ.
ï ÃÂÃÂøÃÂðÃÂ, ÃÂÃÂþ ýð ôðýýþü ÃÂÃÂðÿõ ÿÃÂøûþöõýøõ ëÃÂôÃÂõÃÂýðàúýøóðû ÃÂðñþÃÂðõààþÃÂþÃÂþ. ÃÂýþ òÃÂÿþûýÃÂõàÃÂòþø ýõÃÂûþöýÃÂõ ÃÂÃÂýúÃÂøø ø ÃÂüõõàø÷üõýÃÂÃÂÃÂÃÂàëýð ûõÃÂÃÂû ÿþ ÷ðÿÃÂþÃÂàÿþûÃÂ÷þòðÃÂõûÃÂ. ÃÂýþ ÿÃÂþÃÂÃÂþõ â ø ÃÂÃÂþ ÃÂÃÂÃÂàûø ýõ ÃÂðüþõ óûðòýþõ. ÃÂþ õÃÂÃÂàõÃÂõ ôþÃÂÃÂðÃÂþÃÂýþ ðÃÂÿõúÃÂþò, þ úþÃÂþÃÂÃÂàÃÂÃÂþøà÷ýðÃÂàÿÃÂø ÃÂð÷ÃÂðñþÃÂúõ ñþûõõ ÃÂûþöýÃÂàøýÃÂõÃÂýõÃÂ-ÿÃÂøûþöõýøù. ÃÂàÃÂðÃÂÃÂüþÃÂÃÂøü øàò ÃÂûõôÃÂÃÂÃÂøàÃÂÃÂðÃÂÃÂÃÂàôðýýþù ÃÂõÃÂøø. LXF