关于jsp的介绍生外文翻译_第1页
关于jsp的介绍生外文翻译_第2页
关于jsp的介绍生外文翻译_第3页
关于jsp的介绍生外文翻译_第4页
关于jsp的介绍生外文翻译_第5页
已阅读5页,还剩9页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

xx理工大学xx学院毕业设计(论文)外文资料翻译系:计算机系专业:计算机科学与技术姓名:xxx学号:080601165(用外文写)外文出处:Anon.TheIntroductionOfJSP[EB/OL](用外文写)(2009-01-13)[2011-12-20].http://nibiye.com/fy/wwfy/jsjw/2009/0113/1033.html.附件:1.外文资料翻译译文;2.外文原文。指导教师评语:该译文比较通顺,专业词汇的使用也比较准确,较好地反映了原文的本意,说明该生较好地理解了原文的意思,表明该同学具备一定的阅读外文资料的能力。签名:年月日注:请将该封面与附件装订成册。

附件1:外文资料翻译译文关于JSP的介绍Java2企业版(J2EE)已经把建立一个网上的乱中有律任务的存在现象进行了有效的改造,就是开发人员能使用Java有效创造多层次的服务器端应用程序。今天,Java企业应用程序编程接口已经扩大,包括许多方面:远程方法调用与公共对象请求代理体系结构用来远程对象的处理,JDBC(Java数据库的连接)的数据库交互,JNDI(Java命名和目录接口)来访问命名和目录服务,为企业创造了可重复使用的JavaBeans业务组件、JMS(Java信息服务)消息中介软件,JAXP为XML(可扩展标示语言)处理和JTA(Java事务应用程序界面)为执行一个原子事务。此外,J2EE也支持小型服务程序,极受欢迎的Java语言代替了公共网关接口脚本。这些技术的结合,可以让程序员创造分布式业务解决方案中的各种任务。早在在1999年末,SunMicrosystems(美国一家计算机公司)添加了一个新的精选的元素企业Java工具:Java动态服务器页面(JSP)。Java动态服务器页面都是建立在Java的顶部小型服务器用来增进效率使程序员,甚至是非专业的程序员,都可以创建网页的内容。那么什么是Java服务器页呢?我们来简洁明点,Java的动态服务器页面是一个运用科学技术发展的网页,其中是包括动态内容的。不像一个HTML页面,只包含静态内容,总是保持不变的,一个JSP页面中可以改变它的内容基于任何数量的变项,包括用户的身份,用户的浏览器类型,用户信息的提供,或者由用户选择信息等等。一个JSP页面中包含标准标记语言的元素,例如HTML标签,它也就像是一个正规的网页。然而,一个JSP动态服务器页面中也含有特殊的JSP元素允许服务器插入动态的内容在其页面里。JSP元素可以被用于各种用途,比如检索数据库里的信息或注册用户信息等等。当一个用户访问一个JSP动态服务器页面的时候,服务器执行JSP元素,就会融合静态部分的页面来组成动态页面,并将动态组成页面返回到浏览器,供用户浏览。JSP定义了大量的标准构件,适用于任何的网路式应用程序,比如访问JavaBeans组件,通过控制页和信息共享之间,通过在请求,页面和用户之间。程序员可以也将通过实施特定的应用JSP动态服务器页语法元素来完成任务,比如访问数据库执行任务和访问企业JavaBeans组件,比如发送电子邮件和生成HTML到当前的特殊应用程序的细节数据。这样一套通常需要定制的元素被定义为一个质量指标有联系的JSP规范:JSP标准标签库(JSTL)的规格。结合标准元件和自定义元素允许为建立强大的网络应用程序而提供了强有力的保证。那么我们为什么要使用JSP呢?在很早期的网络开发的时候,公共网关接口(CGI)是动态发展的网页内容的唯一的工具。然而,公共网关接口这并不是一个非常有效的解决方案。为了满足所有开发者的要求,当网络服务器必须创建一个新的操作系统的过程中,负荷翻译和一个脚本的时候,执行了剧本,然后把它们都记录下来了。这对服务器来说是非常繁重繁琐的,增加了很多不必要的操作和流量。后来众多的公共网关接口被代替和改进了,如快速公共网关接口协议,Apache服务器中的mod_perl模块,从NSAPI到美国网景公司,从ISAPI到美国微软公司,从Java小型服务程序到SunMicrosystems公司,这些都在过去的几年里已经形成了。虽然这些解决方案应对措施展现了很好的表现性和可扩展性,但是所有这些技术遭受了一个共同的问题:他们都是直接产生嵌入HTML网页的程序设计语言代码。因为这一原因就需要创造动态网页领域的专门的程序员了。然而Java服务器页,就改变了这一切的一切。JSP拦截问题从另一个方向表明,不是嵌入HTML程序代码,JSP而是让你特别有效成分嵌入HTML网页,这些给HTML元素元素看起来很相似很相似,但当用户请求页面服务器执行时,他们实际上它们都是在幕后构件化Java程式来执行的。这里有一个非常简单的JSP页面,就说明了这一点的内容:<%@taglibprefix="c"url="http://J/jstl/core"%>

<html>

<bodybgcolor="white">

<jsp:useBeanid="clock"class="Java.util.Date"/>

<c:choose>

<c:whentest="${clock.hours<12}">

<h1>Goodmorning!</h1>

</c:when>

<c:whentest="${clock.hours<18}">

<h1>Goodday!</h1>

</c:when>

<c:otherwise>

<h1>Goodevening!</h1>

</c:otherwise>

</c:choose>

Welcometooursite,open24hoursaday.

</body>

</html>这一页根据一天的时间插入一个不同的消息给用户:如果当地时间是12点之前,则给出“早上好!”,如果在12点和6点给出“美好的一天!”,否则就给出“晚上好!”。当一个用户访问这一页,JSP自动化网络服务器用有效的JSP原理执行逻辑回应,且生成一个页面送回用户的浏览器。例如,如果现在的时间是下午8:53,从服务器发送到浏览器的最终页面看起来像这样:<Html>

<bodybgcolor="white">

<h1>Goodevening!</h1>

Welcometooursite,open24hoursaday.

</body>

</html>除了很像超文本标记语言的JSP元素,一个JSP页面中也含有Java代码嵌在所谓的脚本的元素。这一特点已经是最早版本JSP规范的一种了,它用来起来非常方便非常简单而且很有条件逻辑性。通过引入新的JSP标准标签库(JSTL),所以就使得Java代码页是完全没必要的。此外,太多的代码嵌入网页中并不比使用超文本标记语言元素在一个服务器端程序好多少,而且通常会导致有一个网络应用程序请求,这是很难维护和调试的。使用合适的人做每一项合适的任务。当我们早些时候,JSP是允许你把标记语言代码,如HTML,用程序语言代码来处理用户输入,访问数据库和执行其他应用的任务操作。这种分离发生的一种方法是通过使用JSP标准和自定义元素,这些元素是实现和应用程序代码一样标是记元素在常规页网页中的。另一种方法来分离是结合JSP和其他J2EE技术。例如,Java小服务程序可以处理输入后处理,企业JavaBeans(EJB)能够照顾应用的程序的逻辑,和JSP页面可以提供用户界面。这种JSP方法的分离意味着,典型的企业可以分为两组人,他们其中有自己的领域的专业知识的Java程序员可以一起作为开发团队,开发网站实施应用逻辑作为小服务程序,商业应用组件技术和自定义JSP元素,这就使网页具体的工艺的作者使用功能强大的自定义界面元素而就不需要做任何编程。最后整合与企业Java的编程接口,因为都是建立在Java服务器网页上方的Java应用程序界面,JSP拥有所有的强大的企业Java的应用程序接口,这些都包括:•JDBC(Java数据库的连接)

•RemoteMethodInvocation(RMI)andOMGCORBAsupport(远程方法调用)

•JNDI(JavaNamingandDirectoryInterface)(命名目录服务)

•EnterpriseJavaBeans(EJB)(JAVA中的商业应用组件技术)

•JMS(JavaMessageService)(Java消息服务)

•JTA(JavaTransactionAPI)(事物处理构架)

•JAXP(JavaAPIforXMLProcessing)(用于XML文档处理的使用Java语言编写的编程接口)

•JavaMail(提供给开发者处理电子邮件相关的编程接口)这意味着你可以更加容易地集成Java服务器页面与你现有的Java的企业所需要的解决方案。Javaservlet模板引擎。一个Java小型服务程序模板引擎就是另一种技术表现了,从加工到分离。当小型服务程序流行起来,没过多久开发商意识到这是多么难以维护的啊,HTML代码演示部分直接嵌入Java小服务程序的代码。结果就导致了,相当多的所谓的模板引擎已经发展开源产品的帮助获取小服务程序中HTML的值。使用模板引擎的目的是,可以使用纯代码元件(servlets)和使用的网页脚本代码,这仅仅是表现了部分内容。请求被送到一个servlet加工的要求,创造物体,展现了结果,并呼吁一个网页生成的HTML模板将被派到浏览器。包含脚本代码模板描述相似的选择更早。脚本语言使用的这些引擎都缺少一点点的强大,然而,由于脚本只限于读数据对象和生成HTML代码显示其存在的价值。所有其他产品和技术支持的通用语言(这可以是好的也可以是坏的)被用于包括在业务逻辑页面中。结合了最重要的特征中发现的办法:•JSP既支持脚本语言也支持基于动态元素的内容,并允许程序员开发自己定义的标签库以用来满足特定应用的需要。•JSP页面可以进行非常有效的服务器处理和编译。•JSP页面可通过Javaservlet支持模板引擎以来用于处理servlets结合商业逻辑的模型。此外JSP还有有几个非常独特的优点,这就使它得以脱颖而出了。•JSP是一个质量指标,而不是一个产品。这意味着供应商可以根据不同的要求来实现不同的方案,从而引导他们走向更好的性能和更好的质量。它也会导致一个较不明显的优势,就是即当许多公司已经投入了大量的时间和金钱在技术上,非常可能的是这将会在很长一段时间内,以合理的保证的新版本将会和一个专有的技术反向兼容;这并不是一个总是考虑到了的问题。•JSP不可分割的一部分就是J2EE,它为企业级应用提供了一个非常完整的平台。这意味着JSP能在其中可以扮演一个最简单的应用程序角色,也可以扮演最复杂最苛刻角色。

附件2:外文原文(复印件)TheIntroductionOfJSPTheJava2EnterpriseEdition(J2EE)hastakentheonce-chaotictaskofbuildinganinternetpresenceandtransformedittothepointwheredeveloperscanuseJavatoefficientlycreatemultitier,server-sideapplications.Today,theJavaEnterpriseAPIshaveexpandedtoencompassanumberofareas:RMIandCORBAforremoteobjecthandling,JDBCfordatabaseinteraction,JNDIforaccessingnaminganddirectoryservices,EnterpriseJavaBeansforcreatingreusablebusinesscomponents,JMS(JavaMessagingService)formessageorientedmiddleware,JAXPforXMLprocessing,andJTA(JavaTransactionAPI)forperformingatomictransactions.Inaddition,J2EEalsosupportsservlets,anextremelypopularJavasubstituteforCGIscripts.Thecombinationofthesetechnologiesallowsprogrammerstocreatedistributedbusinesssolutionsforavarietyoftasks.

Inlate1999,SunMicrosystemsaddedanewelementtothecollectionofEnterpriseJavatools:JavaServerPages(JSP).JavaServerPagesarebuiltontopofJavaservletsandaredesignedtoincreasetheefficiencyinwhichprogrammers,andevennonprogrammers,cancreatewebcontent.

WhatIsJavaServerPages?

Putsuccinctly,JavaServerPagesisatechnologyfordevelopingwebpagesthatincludedynamiccontent.UnlikeaplainHTMLpage,whichcontainsstaticcontentthatalwaysremainsthesame,aJSPpagecanchangeitscontentbasedonanynumberofvariableitems,includingtheidentityoftheuser,theuser'sbrowsertype,informationprovidedbytheuser,andselectionsmadebytheuser.

AJSPpagecontainsstandardmarkuplanguageelements,suchasHTMLtags,justlikearegularwebpage.However,aJSPpagealsocontainsspecialJSPelementsthatallowtheservertoinsertdynamiccontentinthepage.JSPelementscanbeusedforavarietyofpurposes,suchasretrievinginformationfromadatabaseorregisteringuserpreferences.WhenauserasksforaJSPpage,theserverexecutestheJSPelements,mergestheresultswiththestaticpartsofthepage,andsendsthedynamicallycomposedpagebacktothebrowser.

JSPdefinesanumberofstandardelementsthatareusefulforanywebapplication,suchasaccessingJavaBeanscomponents,passingcontrolbetweenpagesandsharinginformationbetweenrequests,pages,andusers.ProgrammerscanalsoextendtheJSPsyntaxbyimplementingapplication-specificelementsthatperformtaskssuchasaccessingdatabasesandEnterpriseJavaBeans,sendingemail,andgeneratingHTMLtopresentapplication-specificdata.OnesuchsetofcommonlyneededcustomelementsisdefinedbyaspecificationrelatedtotheJSPspecification:theJSPStandardTagLibrary(JSTL)specification.Thecombinationofstandardelementsandcustomelementsallowsforthecreationofpowerfulwebapplications.

WhyUseJSP?

IntheearlydaysoftheWeb,theCommonGatewayInterface(CGI)wastheonlytoolfordevelopingdynamicwebcontent.However,CGIisnotanefficientsolution.Foreveryrequestthatcomesin,thewebserverhastocreateanewoperating-systemprocess,loadaninterpreterandascript,executethescript,andthentearitalldownagain.Thisisverytaxingfortheserveranddoesn'tscalewellwhentheamountoftrafficincreases.

NumerousCGIalternativesandenhancements,suchasFastCGI,mod_perlfromApache,NSAPIfromNetscape,ISAPIfromMicrosoft,andJavaservletsfromSunMicrosystems,havebeencreatedovertheyears.Whilethesesolutionsofferbetterperformanceandscalability,allthesetechnologiessufferfromacommonproblem:theygeneratewebpagesbyembeddingHTMLdirectlyinprogramminglanguagecode.Thispushesthecreationofdynamicwebpagesexclusivelyintotherealmofprogrammers.JavaServerPages,however,changesallthat.

JSPtacklestheproblemfromtheotherdirection.InsteadofembeddingHTMLin

programmingcode,JSPletsyouembedspecialactiveelementsintoHTMLpages.TheseelementslooksimilartoHTMLelements,butbehindthescenestheyareactually

componentizedJavaprogramsthattheserverexecuteswhenauserrequeststhepage.Here'sasimpleJSPpagethatillustratesthis:

<%@taglibprefix="c"url="http://J/jstl/core"%>

<html>

<bodybgcolor="white">

<jsp:useBeanid="clock"class="Java.util.Date"/>

<c:choose>

<c:whentest="${clock.hours<12}">

<h1>Goodmorning!</h1>

</c:when>

<c:whentest="${clock.hours<18}">

<h1>Goodday!</h1>

</c:when>

<c:otherwise>

<h1>Goodevening!</h1>

</c:otherwise>

</c:choose>

Welcometooursite,open24hoursaday.

</body>

</html>

Thispageinsertsadifferentmessagetotheuserbasedonthetimeofday:"Goodmorning!"ifthelocaltimeisbefore12P.M.,"Goodday!"ifbetween12P.M.and6P.M.,and"Goodevening!"otherwise.Whenauserasksforthispage,theJSP-enabledwebserverexecutesthelogicrepresentedbythehighlightedJSPelementsandcreatesanHTMLpagethatissentbacktotheuser'sbrowser.Forexample,ifthecurrenttimeis8:53P.M.,theresultingpagesentfromtheservertothebrowserlookslikethis:

<Html>

<bodybgcolor="white">

<h1>Goodevening!</h1>

Welcometooursite,open24hoursaday.

</body>

</html>

InadditiontotheHTML-likeJSPelements,aJSPpagecanalsocontainJavacodeembeddedinso-calledscriptingelements.ThisfeaturehasbeenpartoftheJSPspecificationfromtheveryfirstversion,anditusedtobeconvenientforsimpleconditionallogic.WiththeintroductionofthenewJSPStandardTagLibrary(JSTL),however,Javacodeinapageisrarelyneeded.Inaddition,embeddingtoomuchcodeinawebpageisnobetterthanusingHTMLelementsinaserver-sideprogram,andoftenleadstoawebapplicationthatishardtomaintainanddebug.

UsingtheRightPersonforEachTaskAsIalludedtoearlier,JSPallowsyoutoseparatethemarkuplanguagecode,suchasHTML,fromtheprogramminglanguagecodeusedtoprocessuserinput,accessadatabasesandperformotherapplicationtasks.OnewaythisseparationtakesplaceisthroughtheuseoftheJSPstandardandcustomelements;theseelementsareimplementedwithprogrammingcodeandusedthesamewayaspagemarkupelementsinregularwebpages.

AnotherwaytoseparateistocombineJSPwithotherJ2EEtechnologies.Forexample,Javaservletscanhandleinputprocessing,EnterpriseJavaBeans(EJB)cantakecareoftheapplicationlogic,andJSPpagescanprovidetheuserinterface.

ThisseparationmeansthatwithJSP,atypicalbusinesscandivideitseffortsamongtwogroupsthatexcelintheirownareasofexpertise:aJavawebdevelopmentteamwithprogrammerswhoimplementtheapplicationlogicasservlets,EJBandcustomJSPelements,andpageauthorswhocraftthespecificsoftheinterfaceandusethepowerfulcustomelementswithouthavingtodoanyprogramming.

IntegrationwithEnterpriseJavaAPIs

Finally,becauseJavaServerPagesarebuiltontopoftheJavaServletsAPI,JSPhasaccesstoallthepowerfulEnterpriseJavaAPIs,including:

•JDBC

•RemoteMethodInvocation(RMI)andOMGCORBAsupport

•JNDI(JavaNamingandDirectoryInterface)

•EnterpriseJavaBeans(EJB)

•JMS(JavaMessageService)

•JTA(JavaTransactionAPI)

•JAXP(JavaAPIforXMLProcessing)

•JavaMail

ThismeansthatyoucaneasilyintegrateJavaServerPageswithyourexistingJavaEnterprisesolutions.

Javaservlettemplateengines.AJavaservlettemplateengineisanothertechnologyforseparatingpresentationfromprocessing.Whenservletsbecamepopular,itdidn'ttakelongbeforedevelopersrealizedhowharditwastomaintainthepresentationpartwhentheHTMLcodewasembeddeddirectlyintheservlet'sJavacode.Asaresult,anumberofso-calledtemplateengineshavebeendevelopedasopensourceproductstohelpgetHTMLoutoftheservlets.

Templateenginesareintendedtobeusedwithpurecodecomponents(servlets)andtousewebpageswithscriptingcodeonlyforthepresentationpart.Requestsaresenttoaservletthatprocessestherequest,createsobjectsthatrepresenttheresult,andcallsonawebpagetemplatetogeneratetheHTMLtobesenttothebrowser.Thetemplatecontainsscriptingcodesimilartothealternativesdescribedearlier.Thescriptinglanguagesusedbytheseenginesarelesspowerful,however,sincescriptingisintendedonlyforreadingdataobjectsandgeneratingHTMLcodetodisplaytheirvalues.Alltheotherproductsandtechnologiessupportgeneral-purposelanguages,whichcan(forbetterorforworse)beusedtoincludebusinesslogicinthepages.

combinesthemostimportantfeaturesfoundinthealternatives:

•JSPsupportsbothscripting-andelement-baseddynamiccontentandallows

programmerstodevelopcustomtaglibrariestosatisfyapplication-specificneeds.

•JSPpagesarecompiledforefficientserverprocessing.

•JSPpagescanbeusedincombinationwithservletsthathandlethebusinesslogic,themodelsupportedbyJavaservlettemplateengines.Inaddition,JSPhasacoupleofuniqueadvantagesthatmakeitstandoutfromthecrowd:

•JSPisaspecification,notaproduct.Thismeansvendorscancompetewithdifferentimplementations,leadingtobetterperformanceandquality.Italsoleadstoalessobviousadvantage,namelythatwhensomanycompanieshaveinvestedtimeandmoneyinthetechnology,chancesareitwillbearoundforalongtime,withreasonableassurancesthatnewversionswillbebackward-compatible;withaproprietarytechnology,thisisnotalwaysagiven.

•JSPisanintegralpartofJ2EE,acompleteplatformforenterpriseclassapplications.ThismeansthatJSPcanplayapartinthesimplestapplicationstothemostcomplexanddemanding.目录TOC\o"1-2"\h\z第一章项目基本情况 3一、项目情况说明 3二、可行性研究的依据 5第二章项目建设的必要性与可行性 8一、项目建设背景 8二、项目建设的必要性 9三、项目建设的可行性 14第三章市场供求分析及预测 17一、项目区生猪养殖和养殖粪污的利用现状 17二、禽畜粪污产量、沼气及沼肥产量调查与分析 18三、项目产品市场前景分析 20第四章项目承担单位的基本情况 21一、养殖场概况 21二、资产状况 21三、经营状况 21第五章项目地点选择分析 23一、选址原则 23二、项目选点 23三、项目区建设条件 24第六章 工艺技术方案分析 27一、污水处理模式的选择 27二、处理工艺的选择 29三、项目工艺流程 31四、主要技术参数 35五、主要设备选型 39第七章项目建设目标 40一、项目建设目标 40二、项目建设规模 40第八章项目建设内容 42一、建安工程 42二、仪器设备 46第九章投资估算和资金筹措 48HYPERL

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论