




已阅读5页,还剩5页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
0外文原文BookdescriptionJSPdevelopersencounteruniqueproblemswhenbuildingwebapplicationsthatrequireintensedatabaseconnectivity.MySQLandJSPWebApplicationsaddressesthechallengesofbuildingdata-drivenapplicationsbasedontheJavaServerPagesdevelopmentmodel.MySQLandJSPWebApplicationsbeginswithanoverviewofthecoretechnologiesrequiredforJSPdatabasedevelopment-JavaServerPages,JDBC,andthedatabaseschema.ThebookthenoutlinesandpresentsanInternetcommerceapplicationthatdemonstratesconceptssuchasreceivingandprocessinguserinput,designingandimplementingbusinessrules,andbalancingtheuserloadontheserver.ThroughtheJDBC(JavaDataBaseConnector),thedevelopercancommunicatewithmostcommercialdatabases,suchasOracle.ThesolutionspresentedinMySQLandJSPWebApplicationscenterontheopensourcetoolsMySQLandTomcat,allowingthereaderanaffordablewaytotestapplicationsandexperimentwiththebooksexamples.AnIntroductiontoDevelopingE-CommerceApplicationswithJSP.WhoAreYouandWhyAreYouReadingThisBook?SoWhatIsJSPAllAbout?AnOverviewofJSPPlatforms.WhyDoWeNeedDatabases?MySQL.PuttingTomcatandMySQLTogether.ARoadmaptoE-CommerceDevelopment.authorsbriefintroductionJamesTurneristhemanagerofBlackBearSoftware,LLC.Hehasmorethan22yearsofexperienceinthecomputerfieldandhasworkedfororganizationsthatincludeMIT,Xerox,SolbourneComputer,BBNPlanet,andInterleaf.Hehasspentthelastsevenyearsmanagingandimplementinge-commerceWebsitesforcompaniesincludingCVS,TheChristianScienceMonitor,andWoolworthsUK.Mr.Turnerisalsoawell-publishedfreelancejournalistandtechnologywriterwhohaswrittenforpublicationsincludingTheChristianScienceMonitor,WIRED,andWebDevelopersJournal.HelivesinDerry,NewHampshire,ina200-year-oldcolonialfarmhousealongwithhiswifeandson.1IntroductiontoJSPandhowthingsworkThegoalofthisappendixistointroduceJSP.Throughexamples,wewellcoverthebasicsofJSP,butrathertogiveanewprogrammerenoughknowledgetobeginusingJSPproductively.WeexpectthatyoualreadyhavesomebasicJavaandHTMLknowledge.JSPBasicsJSPisasimpleJava-basicspecificationforbuildingdynamicWebsites.AsanextensionofJavaservlets,JSPwasdesignedtosimplifytheuseofservlets.Asaresult,JSPisoptimizedtoproducecharacter-basedoutputtoaclient,typicallyapersonusingaWebbrowser.AnewJSPdeveloperneedstoknowsixfactsaboutservlets.1.JSPisonlydesignedtoperformcharacter-basedoutput.WhenaJSPpagebecomesaservlet,thatservletisalsobuilttosendcharacter-basedoutput.SinceXMLis100%characterbased,wehavenoneedtodobinaryoperationsforthisbook.2.AllJSPpagesareautomaticallycompiledintoaservletbytheJSPcontainer.AsaJSPprogrammer,theonlyrequiredknowledgeistheJSPcode,becausethecontainerwilltakecareoftherest.3.SinceJSPisbuiltontopofservlets,thedocumentationforsomeoftheJSPobjectscanbefoundwithintheservletdocumentation.Wewillindicatewhenthisisthecase.4.OnereasonJSPprogrammerseventuallywriteservletsastheygetmoreexperiencedisthatservletsprovidetheabilitytoperformfilteringonarequestandresponse.Filteringistheabilitytoaddaprocessingstepeitherbeforeoraftertherequestedresource.Forexample,wecouldhaveourJSPpagesoutputXMLonly,andhaveafilterthatwouldapplyanXSLstylesheettothatgeneratedXML.Theresultwouldthenbesenttotherequestingclient.FiltersarepartoftheServlet2.3specification.5.AnotherreasonJSPprogrammerswillwanttoservletscomesfromtheuseoflisteners.AlistenerisawaytoaddJSPeventstoyourJavaobjects.ThismeansthattheJSPcontainercannotifyyourobjectofeventssuchaswhentheapplicationstartsorends,or2whenauserlogson,oroneofafewotherpredefinedJSPevents.Asanexample,itispossibletobuildalistenerthatistriggeredwhenaJSPapplicationfirststartsup.Uponstartup,anobjectcouldcreateandreadinitializationXMLfilesfortheapplication.ListenersarepartoftheServlet2.3specification.6.AdvancedJSPprogrammerstendtouseservletfornonvisualprocessing.Anexampleofthiswouldbeacontrollerpage.Thesepagesneverdisplayaresult,butratherredirecttraffictootherJSPpages.JSPpagescanstillbeusedtoperformnonvisualprocessing;servletsarejustalittlemorerobustforthistask.Severalchaptersofthisbookexploreservlets.InChapter7,”SuccessfullyUsingJSPandXMLinanApplication,”webuildalistenertoimportanXMLinitializationfilewhentheapplicationstart.InChapter10,”UsingXSL/JSPinWebSiteDesign,”wewriteaservlettoprocessXMLfilesgenerically.Finally,inChapter15,”AdvancedApplicationDesign,”weshowhowtobuildasecurityfilter.Keepinmind,itispossiblethataJSPprogrammerwillneverneedstodirectlyprogramaservlet.However,morecommonly,asJSPdevelopersgetmoreexperiencedinJSP,theywilllearnafewbasictrickswithservletstoexpandtheirJSPapplications.IntroductiontoJSPIntroductiontoJSPJavaServerPagesorJSPforshortisSunssolutionfordevelopingdynamicwebsites.JSPprovideexcellentserversidescriptingsupportforcreatingdatabasedrivenwebapplications.JSPenablethesituationpossible.JSPTutorials-WritingFirstJSPJavaServerPagesorJSPforshortisSunssolutionfordevelopingdynamicwebsites.JSPprovideexcellentserversidescriptingsupportforcreatingdatabasedrivenwebapplications.JSPenablethedeveloperstodirectlyinsertjavacodeintojspfile,thismakesthedevelopmentprocessverysimpleanditsmaintenancealsobecomesveryeasy.JSPpagesareefficient,itloadsintothewebserversmemoryonreceivingtherequestveryfirsttimeandthesubsequentcallsareservedwithinaveryshortperiodoftime.Intodaysenvironmentmostwebsitesserversdynamicpagesbasedonuserrequest.Databaseisveryconvenientwaytostorethedataofusersandotherthings.JDBCprovide3excellentdatabaseconnectivityinheterogeneousdatabaseenvironment.UsingJSPandJDBCitsveryeasytodevelopdatabasedrivenwebapplication.Javaisknownforitscharacteristicofwriteonce,runanywhere.JSPpagesareplatformindependent.Yourportyour.jsppagestoanyplatform.InstallingJSPFirstofalldownloadJavaServerWebDevelopmentKit(JSWDK1.0.1)from/products/servlet/download.html.JSWDKcomeswithfulldocumentationanditsveryeasytoinstall,sotheinstallationprocessisnotmentionedhere.TheJSWDKistheofficialreferenceimplementationoftheservlet2.1andJSP1.0specifications.Itisusedasasmallstand-aloneserverfortestingservletsandJSPpagesbeforetheyaredeployedtoafullWebserverthatsupportsthesetechnologies.Itisfreeandreliable,buttakesquiteabitofefforttoinstallandconfigure.OtherServersthatsupportJSP1.ApacheTomcat.Tomcatistheofficialreferenceimplementationoftheservlet2.2andJSP1.1specifications.Itcanbeusedasasmallstand-aloneserverfortestingservletsandJSPpages,orcanbeintegratedintotheApacheWebserver.2.AllaireJRun.JRunisaservletandJSPenginethatcanbepluggedintoNetscapeEnterpriseorFastTrackservers,IIS,MicrosoftPersonalWebServer,olderversionsofApache,WebSite,orStarNineWebSTAR.3.NewServletExec.ServletExecisafastservletandJSPenginethatcanbepluggedintomostpopularWebserversforSolaris,Windows,MacOS,HP-UXandLinux.Youcandownloadanduseitforfree,butmanyoftheadvancedfeaturesandadministrationutilitiesaredisableduntilyoupurchasealicense.4.GefionsLiteWebServer(LWS).LWSisasmallfreeWebserverthatsupportsservletsversion2.2andJSP1.1.45.GNUJSP.free,opensourceenginethatcanbeinstalledonapachewebserver.6.PolyJSP.PolyJspisbasedonXML/XSLandhasbeendesignedtobeextensible.NowsupportsWebL7.JRUN.AvailableforIISserver.8.WebSphere.IBMsWebSphereverylargeapplicationservernowimplementsJSP.9.XMLasaBridgebetweenSQLandWebApplicationsbyAlexanderProhorenkoandOlexiyProkhorenkoOriginallypublishedonBEADev2DevJune2005AbstractOverthepastfewyearsXMLtechnologyhasgainedgreatpopularityasaformatforexchanginginformationovertheInternet.Today,XMLisoftenportrayedasadistincttechnology,butinitiallyitwasbornasanInternettechnology(somewherebetweenHTMLandSGML).ThisarticlelooksathowXMLcanbeusedasatransportprotocolbetweenadatabaseandanenduser.ThemostpopularrelationaldatabasemanagementsystemsuseSQLqueriesforworkingwithdata.AlthoughXML-orienteddatabasesarealreadyonthemarket,theyarenotyetubiquitous.KeepinginmindthepopularityofXML,thedevelopersofrelationaldatabasesaremovingforwardbyaddingXMLcompatibilitytotheirproducts.Thisarticlelooksatonesuchapproach:havingadatabasereturnXML.AnOracledatabaseisusedinthesamplecode,whichissupposedtobeanXML-compliantdatabasethatalreadyhasamechanismforworkingwithXMLdata.Thisarticlewillbedividedintotwoparts.InthefirstpartwellprepareJavacodetoworkwithanOracledatabase,makeanSQLquery,andreceiveXMLoutput.ThesecondpartwillbedevotedtoawebapplicationthatwillreceiveXMLdatafromthedatabaseandoutputitasHTMLtext.RequirementsThefollowingsoftwareisusedinthisarticle:BEAWebLogicPlatform8.1withSP4astheapplicationserver.Oracle10gDatabaseServerasthedatabaseserver.Youcantrythecodewithdifferent5versions;asfarasweknow,thissolutiondoesnotrequireaspecificversion.OracleXML-SQLUtility(XSU).TheOracleXML-SQLUtilityisasetofJavaclassesandPL/SQLwrappersthatpermitqueriestoreturnresultsetsorobjectswrappedinXML.OracleXMLParser,Version2.OraclesJava-basedvalidatingXMLparser,whichhasXSLsupport.Normally,XSUandXMLParserarepartofOracleDeveloperSuite.ThecodeinthisarticlewasrunonMicrosoftWindowsXPbutshouldworkonanyoperatingsystemwithonlyminorchanges.WeassumethatthereaderisanexperiencedJavadeveloperwhoisfamiliarwithBEAWebLogicServerandhassomeexperienceprogrammingwithJDBC.AdvantagesofUsingXMLAsaBridgeWewanttohighlighttheadvantagesoftheXMLtransfermethoddescribedinthistutorialandexplainwhywethinkitsuseful.OneofthequestionsyoumaybeaskingyourselfiswhyweareusingXMLhereandwhywearecallingitabridge.ThebestwaytoexplaintheadvantageofXMLasabridgeisthroughasmallexample.Imagineyouvegotaninformationportal,whichisdesignedtodelivernewsfromtheSQLdatabasetoendusers,whoevertheyare:mobileusersusingWAPbrowsersorregularwebsurferswithmodernbrowsers.Furthermore,you,asaninformationowner,canresellittootherendusers,andyournewsshouldbeshownwithdifferenttitles,likeNewsfromtheAcme,Corp.andLatestnewsfromBigCompanyandwhateverelse.Butthenewsthatyouaredeliveringdoesnotchange.Sowhyshouldyouperformextracodingforeverykindofenduserwhomayreceiveyournews,whenyoutechnicallyneedonlychangethelookandfeel?NowyoucanseethatyouneedsometransparentbridgethatcanreceiveSQLononesideandproducedifferentformatsontheother.ThisbridgeisXML.Yourservletmakesarequesttothedatabase,receivesXMLoutput,andappliesanXSLtemplatetoit,producingapageforanenduser.So,youneedtochangeonlyadesigninXSLandnothingmore.Noextracoding,nowastedtime.Whataboutsharingyournewswithothers?Thatsgreat,butwhyshouldyouallowotherstoaccessyourSQLdatabase?Whyshouldyouexplainthestructureofit?YoucansimplyproduceXMLfromthebasicSQLqueryandshareit.6中文翻译书中描述JSP开发人员在构建web应用程序时遇到的独特问题,需要强烈的数据库连接。MySQL和JSP的Web应用程序地址的挑战构建数据驱动的应用程序基于JavaServerPages发展模式。MySQL和JSP的Web应用程序首先概述JSP数据库开发所需的核心技术JavaServerPages,JDBC和数据库模式。这本书然后轮廓,提出了一种互联网商务应用程序演示的概念,如接收和处理用户输入,设计和实现业务规则,平衡服务器上的用户负载。通过JDBC(Java数据库连接器),开发人员可以与大多数商业数据库,如甲骨文。MySQL和JSP的Web应用程序中提供的解决方案中心的开放源码工具MySQL和Tomcat,让读者一种可行的方法来测试应用程序和试验的书的例子。介绍用JSP开发电子商务应用程序。你是谁,你为什么要读这本书?JSP是什么吗?JSP平台的概述。为什么我们需要数据库吗?mysql。一起把Tomcat和MySQL。电子商务发展路线图。作者的简介詹姆斯特纳是黑熊的经理软件公司。他在计算机领域超过22年的经验,并为组织工作,包括麻省理工学院,施乐,Solbourne电脑,BBN星球,插页。他在过去的七年管理和企业实施电子商务的网站包括CVS,英国基督教科学箴言报,沃尔沃斯。特纳先生也是一个编外自由记者和技术作家曾写过基督教科学箴言报等刊物,连线杂志,Web开发人员。他住在德里,新罕布什尔州,200岁高龄的殖民农舍连同他的妻子和儿子。介绍JSP和事物是如何工作的这个附录的目标是介绍JSP。通过例子,我们好讨论JSP的基本知识,而是给一个新的程序员足够的知识开始使用JSP有效。我们希望您已经有了一些基本的Java和HTML的知识。JSP基础知识JSP是一个简单的Java-basic规范构建动态Web站点。作为一个扩展的Javaservlet,JSP是为了简化使用servlet。因此,JSP优化生产基于字符输出到客户端,通常一个人使用一个Web浏览器。一个新的JSP开发人员需要六个事实了解servlet。1、JSP仅仅是设计来执行基于字符的输出。成为一个servlet,JSP页面时,servlet也用来发送字符的输出。由于XML是100%基于字符的,我们不需要为这本书做二进制操作。2、所有JSP页面会自动编译成servlet,JSP容器。作为一个JSP程序员,唯一需要知识的JSP代码,因为其余的容器会照顾。3、由于JSP在servlet之上,文档的一些JSP在servlet文件中可以找到对象。我们将在这种情况下指明。4、JSP最终程序员编写servlet的原因之一,因为他们得到更多的经验是,servlet提供执行过滤请求和响应的能力。过滤是添加一个处理步骤的能力之前或之后所请求的资源。例如,我们可以只有我们的JSP页面输出XML,并有一个过滤器,应用一个XSL样式表生成的XML。结果将被发送到发出请求的客户机。过滤器是Servlet2.3规范的一部7分。5、JSP程序员需要servlet的另一个原因来自听众的使用。一个侦听器是一种将JSP事件添加到您的Java对象。这意味着JSP容器可以通知对象等事件的应用程序开始或结束时,或者当一个用户登录,或其他一些预定义的JSP事件之一。作为一个例子,可以构建一个侦听器,一个JSP应用程序第一次启动时触发。启动时,一个对象可以创建和读取初始化应用程序的XML文件。听众是Servlet2.3规范的一部分。6、先进的JSP程序员倾向于使用servlet进行非可视化处理。这将是一个控制器的一个示例页面。这些页面不显示结果,而是流量重定向到其他JSP页面。JSP页面仍然可以用来执行其非加工;servlet只是一个更健壮的任务。这本书的几章探索servlet。在第7章,“成功使用JSP和XML应用程序中,我们建立一个侦听器导入XML应用程序启动时初始化文件。在第十章,“使用XSL/JSP在网站设计中,“我们编写一个servlet来处理XML文件。最后,在第15章,“先进的应用程序设计,我们展示了如何建立一个安全过滤器。记住,有可能是一个JSP程序员永远不会直接需要计划一个servlet。但更常见,作为JSPJSP开发人员得到更多的经验,他们会学习一些基本技巧与servlet扩展他们的JSP应用程序。介绍JSP,介绍JSPJavaServer网页或介绍短JSP是Sun的Java服务器页面或JSP开发动态web站点的解决方案。JSP提供优秀的服务器端脚本支持创建数据库驱动的web应用程序。JSP使这一切变得可能。JSP教程,写第一个JSPJavaServerPages或短JSP是Sun的Java服务器页面或JSP开发动态web站点的解决方案。JSP提供优秀的服务器端脚本支持创建数据库驱动的web应用程序。JSP使开发人员能够直接将java代码插入到JSP文件,这使得开发过程非常简单和维护也变得非常容易。JSP页面是有效的,它加载到web服务器内存接收请求第一次和随后的调用是在很短的时间内。在今天的环境大多数web站点服务器根据用户请求动态页面。数据库是非常方便的方式来存储用户的数据和其他东西。JDBC提供优秀的数据库连接异构数据库环境。使用JSP和JDBC很容易开发数据库驱动的web应用程序。Java是闻名的“编写一次,到处运行的特点。“JSP页面是平台独立的。你的港口。jsp页面的任何平台。安装的JSP首先从/products/servlet/download.html下载JavaServerWeb开发的工具包(JSWDK1.0.1)。JSWDK附带完整的文档和它很容易安装,所以这里没有提到的安装过程。JSWDK是官方servlet2.1和JSP1.0规范的参考实现。它是用于小型独立服务器测试servlet和JSP页面之前部署到一个完整的Web服务器,支持这些技术。它是免费的和可靠的,但需要相当多的努力来安装和配置。支持JSP的其他服务器1、ApacheTomcatTomcat是官方的servlet2.2和JSP1.1规范的参考实现。它可以用于小型独立服务器测试servlet和JSP页面,或者可以集成到ApacheWeb服务器。2、AllaireJRun.JRun是一个servlet和JSP引擎,可以插入网景企业或FastTrack服务器IIS,微软个人8Web服务器,旧版本的Apache,网站,或者StarNineWebSTAR。3、新ServletExecServletExec是一个快速的servlet和JSP引擎,可以插入为Solaris最流行的Web服务器,窗户,MacOS、hp-ux、Linux。你可以免费下载和使用,但许多高级功能和管理工具被禁用,直到你购买一个许可证。4、GefionLiteWebServer(LWS)。LWS是一个免费的Web服务器,支持servlet1.1和JSP2.2版本。5、GNUJSP。免费,开源引擎,可以安装在apacheweb服务器。6、PolyJSP。PolyJsp基于XML/XSL和被设计成可扩展的。现在支持WebL7、JRUN。IIS服务器。8、WebSphere。IBM的WebSphere应用服务器非常大的现在实现JSP。9、XMLXML作为SQL和Web应用程序之间的一座桥梁由亚历山大Prohorenko和OlexiyProkhorenko最早出版于2005年6月BEADev2Dev文摘在过去的几年中XML技术获得了大受欢迎在互联网上作为交换信息的格式。今天,XML常常被描绘成一个不同的技术,但它最初诞生作为互联网技术(HTML和SGML之间)。本文将介绍如何使用XML数据库之间的传输协议”和最终用户。最流
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 中班数学活动《对应》教学设计
- 关于第一次讲解
- 医院消防应急预案演讲
- 肿瘤病人的康复护理
- 医院物品保管人员培训
- 2025年黑龙江省“市委书记进校园”事业单位引才招聘考试(护理学)历年参考题库含答案详解(5套)
- 2025年高级物流师考试(中物联)《现代物流概论》历年参考题库含答案详解(5套)
- 2025年高等教育经济类自考-05083投资经济学历年参考题库含答案解析(5套典型题)
- 2025年高等教育经济类自考-00066货币银行学历年参考题库含答案解析(5套典型题)
- 2025年高等教育法学类自考-00229证据法学历年参考题库含答案解析(5套典型题)
- 手机媒体概论(自考14237)复习题库(含真题、典型题)
- 2025-2030中国直升机旅游行业市场深度调研及发展趋势与投资前景预测研究报告
- 钩针编织技术课件
- 2025年中考数学几何模型归纳训练:最值模型之阿氏圆模型解读与提分训练
- 2025年民航安全试题简答题及答案
- 2025年事业编畜牧笔试试题及答案
- 江苏省职教高考烹饪类专业知识考试复习题(附答案)
- 焊接技术培训(基础教程)课件
- 珠海广东珠海万山海洋开发试验区发展改革和政策研究局招聘合同制职员笔试历年典型考点(频考版试卷)附带答案详解
- 特种设备安全法培训课件
- 2024年机动车检测站质量手册程序文件记录表格合集(根据补充要求编制)
评论
0/150
提交评论