JSP应用框架论文中英文资料对照外文翻译文献综述Word文档下载推荐.docx

上传人:b****5 文档编号:19101807 上传时间:2023-01-03 格式:DOCX 页数:10 大小:27.16KB
下载 相关 举报
JSP应用框架论文中英文资料对照外文翻译文献综述Word文档下载推荐.docx_第1页
第1页 / 共10页
JSP应用框架论文中英文资料对照外文翻译文献综述Word文档下载推荐.docx_第2页
第2页 / 共10页
JSP应用框架论文中英文资料对照外文翻译文献综述Word文档下载推荐.docx_第3页
第3页 / 共10页
JSP应用框架论文中英文资料对照外文翻译文献综述Word文档下载推荐.docx_第4页
第4页 / 共10页
JSP应用框架论文中英文资料对照外文翻译文献综述Word文档下载推荐.docx_第5页
第5页 / 共10页
点击查看更多>>
下载资源
资源描述

JSP应用框架论文中英文资料对照外文翻译文献综述Word文档下载推荐.docx

《JSP应用框架论文中英文资料对照外文翻译文献综述Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《JSP应用框架论文中英文资料对照外文翻译文献综述Word文档下载推荐.docx(10页珍藏版)》请在冰豆网上搜索。

JSP应用框架论文中英文资料对照外文翻译文献综述Word文档下载推荐.docx

JSPAPPLICATIONFRAMEWORKS

1.1WHATAREAPPLICATIONFRAMEWORKS:

Aframeworkisareusable,semi-completeapplicationthatcanbespecializedtoproducecustomapplications[Johnson].Likepeople,softwareapplicationsaremorealikethantheyaredifferent.Theyrunonthesamecomputers,expectinputfromthesamedevices,outputtothesamedisplays,andsavedatatothesameharddisks.Developersworkingonconventionaldesktopapplicationsareaccustomedtotoolkitsanddevelopmentenvironmentsthatleveragethesamenessbetweenapplications.Applicationframeworksbuildonthiscommongroundtoprovidedeveloperswithareusablestructurethatcanserveasthefoundationfortheirownproducts.

Aframeworkprovidesdeveloperswithasetofbackbonecomponentsthathavethefollowingcharacteristics:

Frameworksaretheclassicbuild-versus-buyproposition.Ifyoubuildit,youwillunderstanditwhenyouaredone—buthowlongwillitbebeforeyoucanrollyourown?

Ifyoubuyit,youwillhavetoclimbthelearningcurve—andhowlongisthatgoingtotake?

Thereisnorightanswerhere,butmostobserverswouldagreethatframeworkssuchasStrutsprovideasignificantreturnoninvestmentcomparedtostartingfromscratch,especiallyforlargerprojects.

1.2OTHERTYPESOFFRAMEWORKS:

Theideaofaframeworkappliesnotonlytoapplicationsbuttoapplicationcomponentsaswell.Throughoutthisarticle,weintroduceothertypesofframeworksthatyoucanusewithStruts.TheseincludetheLucenesearchengine,theScaffoldtoolkit,theStrutsvalidator,andtheTilestaglibrary.Likeapplicationframeworks,thesetoolsprovidesemi-completeversionsofasubsystemthatcanbespecializedtoprovideacustomcomponent.

Someframeworkshavebeenlinkedtoaproprietarydevelopmentenvironment.ThisisnotthecasewithStrutsoranyoftheotherframeworksshowninthisbook.YoucanuseanydevelopmentenvironmentwithStruts:

VisualAgeforJava,JBuilder,Eclipse,Emacs,andTextpadareallpopularchoicesamongStrutsdevelopers.IfyoucanuseitwithJava,youcanuseitwithStruts.

1.3ENABLINGTECHNOLPGIES:

ApplicationsdevelopedwithStrutsarebasedonanumberofenablingtechnologies.ThesecomponentsarenotspecifictoStrutsandunderlieeveryJavawebapplication.AreasonthatdevelopersuseframeworkslikeStrutsistohidethenastydetailsbehindacronymslikeHTTP,CGI,andJSP.AsaStrutsdeveloper,youdon’tneedtobeanalphabetsoupguru,butaworkingknowledgeofthesebasetechnologiescanhelpyoudevisecreativesolutionstotrickyproblems.

1.4HYPERTEXTTRANSFERPROTOCOL(HTTP):

Whenmediatingtalksbetweennations,diplomatsoftenfollowaformalprotocol.

Diplomaticprotocolsaredesignedtoavoidmisunderstandingsandtokeepnegotiationsfrombreakingdown.Inasimilarvein,whencomputersneedtotalk,theyalsofollowaformalprotocol.Theprotocoldefineshowdataistransmittedandhowtodecodeitonceitarrives.WebapplicationsusetheHypertextTransferProtocol(HTTP)tomovedatabetweenthebrowserrunningonyourcomputerandtheapplicationrunningontheserver.

ManyserverapplicationscommunicateusingprotocolsotherthanHTTP.Someofthesemaintainanongoingconnectionbetweenthecomputers.Theapplicationserverknowsexactlywhoisconnectedatalltimesandcantellwhenaconnectionisdropped.Becausetheyknowthestateofeachconnectionandtheidentityofeachpersonusingit,theseareknownasstatefulprotocols.

Bycontrast,HTTPisknownasastatelessprotocol.AnHTTPserverwillacceptanyrequestfromanyclientandwillalwaysprovidesometypeofresponse,eveniftheresponseisjusttosayno.Withouttheoverheadofnegotiatingandretainingaconnection,statelessprotocolscanhandlealargevolumeofrequests.ThisisonereasonwhytheInternethasbeenabletoscaletomillionsofcomputers.

AnotherreasonHTTPhasbecometheuniversalstandardisitssimplicity.AnHTTPrequestlookslikeanordinarytextdocument.ThishasmadeiteasyforapplicationstomakeHTTPrequests.YoucanevensendanHTTPrequestbyhandusingastandardutilitysuchasTelnet.WhentheHTTPresponsecomesback,itisalsoinplaintextthatdeveloperscanread.

ThefirstlineintheHTTPrequestcontainsthemethod,followedbythelocationoftherequestedresourceandtheversionofHTTP.ZeroormoreHTTPrequestheadersfollowtheinitialline.TheHTTPheadersprovideadditionalinformationtotheserver.Thiscanincludethebrowsertypeandversion,acceptabledocumenttypes,andthebrowser’scookies,justtonameafew.Ofthesevenrequestmethods,GETandPOSTarebyfarthemostpopular.

Oncetheserverhasreceivedandservicedtherequest,itwillissueanHTTPresponse.ThefirstlineintheresponseiscalledthestatuslineandcarriestheHTTPprotocolversion,anumericstatus,andabriefdescriptionofthestatus.Followingthestatusline,theserverwillreturnasetofHTTPresponseheadersthatworkinawaysimilartotherequestheaders.

Aswementioned,HTTPdoesnotpreservestateinformationbetweenrequests.Theserverlogstherequest,sendstheresponse,andgoesblissfullyontothenextrequest.Whilesimpleandefficient,astatelessprotocolisproblematicfordynamicapplicationsthatneedtokeeptrackoftheirusers.

CookiesandURLrewritingaretwocommonwaystokeeptrackofusersbetweenrequests.Acookieisaspecialpacketofinformationontheuser’scomputer.URLrewritingstoresaspecialreferenceinthepageaddressthataJavaservercanusetotrackusers.Bothapproachesareseamless,andusingeithermeansextraworkwhendevelopingawebapplication.Onitsown,astandardHTTPwebserverdoesnottrafficindynamiccontent.Itmainlyusestherequesttolocateafileandthenreturnsthatfileintheresponse.ThefileistypicallyformattedusingHypertextMarkupLanguage(HTML)[W3C,HTML]thatthewebbrowsercanformatanddisplay.TheHTMLpageoftenincludeshypertextlinkstootherwebpagesandmaydisplayanynumberofothergoodies,suchasimagesandvideos.Theuserclicksalinktomakeanotherrequest,andtheprocessbeginsanew.

Standardwebservershandlestaticcontentandimagesquitewellbutneedahelpinghandtoprovideuserswithacustomized,dynamicresponse.

DEFINITION:

StaticcontentontheWebcomesdirectlyfromtextordatafiles,likeHTMLorJPEGfiles.Thesefilesmightbechangedfromtimetotime,buttheyarenotalteredautomaticallywhenrequestedbyawebbrowser.Dynamiccontent,ontheotherhand,isgeneratedonthefly,typicallyinresponsetoanindividualizedrequestfromabrowser.

1.5COMMONGATEWAYINTERFACE(CGI):

ThefirstwidelyusedstandardforproducingdynamiccontentwastheCommonGatewayInterface(CGI).CGIusesstandardoperatingsystemfeatures,suchasenvironmentvariablesandstandardinputandoutput,tocreateabridge,orgateway,betweenthewebserverandotherapplicationsonthehostmachine.Theotherapplicationscanlookattherequestsenttothembythewebserverandcreateacustomizedresponse.

Whenawebserverreceivesarequestthat’sintendedforaCGIprogram,itrunsthatprogramandprovidestheprogramwithinformationfromtheincomingrequest.TheCGIprogramrunsandsendsitsoutputbacktotheserver.Thewebserverthenrelaystheresponsetothebrowser.

CGIdefinesasetofconventionsregardingwhatinformationitwillpassasenvironmentvariablesandhowitexpectsstandardinputandoutputtobeused.LikeHTTP,CGIisflexibleandeasytoimplement,andagreatnumberofCGI-awareprogramshavebeenwritten.

ThemaindrawbacktoCGIisthatitmustrunanewcopyoftheCGI-awareprogramforeachrequest.Thisisarelativelyexpensiveprocessthatcanbogdownhigh-volumesiteswherethousandsofrequestsareservicedperminute.AnotherdrawbackisthatCGIprogramstendtobeplatformdependent.ACGIprogramwrittenforoneoperatingsystemmaynotrunonanother.

1.6JAVASERVLETS:

Sun’sJavaServletplatformdirectlyaddressesthetwomaindrawbacksofCGIprograms.First,servletsofferbetterperformanceandutilizationofresourcesthanconventionalCGIprograms.Second,thewrite-once,run-anywherenatureofJavameansthatservletsareportablebetweenoperatingsystemsthathaveaJavaVirtualMachine(JVM).

AServletlooksandfeelslikeaminiaturewebserver.Itreceivesarequestandrendersaresponse.But,unlikeconventionalwebservers,theServletapplicationprogramminginterface(API)isspecificallydesignedtohelpJavadeveloperscreatedynamicapplications.

TheServletitselfissimplyaJavaclassthathasbeencompiledintobytecode,likeanyotherJavaobject.TheServlethasaccesstoarichAPIofHTTP-specificservices,butitisstilljustanotherJavaobjectrunninginanapplicationandcanleverageallyourotherJavaassets.

Togiveconventionalwebserversaccesstoservlets,theservletsarepluggedintocontainers.TheServletcontainerisattachedtothewebserver.EachServletcandeclarewhatURLpatternsitwouldliketohandle.Whenarequestmatchingaregisteredpatternarrives,thewebserverpassestherequesttothecontainer,andthecontainerinvokestheServlet.

ButunlikeCGIprograms,anewServletisnotcreatedforeachrequest.OncethecontainerinstantiatestheServlet,itwilljustcreateanewthreadforeachrequest.JavathreadsaremuchlessexpensivethantheserverprocessesusedbyCGIprograms.OncetheServlethasbeencreated,usingitforadditionalrequestsincursverylittleoverhead.Servletdeveloperscanusetheinit()methodtoholdreferencestoexpensiveresources,suchasdatabaseconnectionsorEJBHomeInt

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 工程科技 > 纺织轻工业

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1