计算机专业文献翻译用 Tomcat 和 Eclipse开发 Web 应用程序.docx

上传人:b****1 文档编号:1284674 上传时间:2022-10-20 格式:DOCX 页数:20 大小:430.30KB
下载 相关 举报
计算机专业文献翻译用 Tomcat 和 Eclipse开发 Web 应用程序.docx_第1页
第1页 / 共20页
计算机专业文献翻译用 Tomcat 和 Eclipse开发 Web 应用程序.docx_第2页
第2页 / 共20页
计算机专业文献翻译用 Tomcat 和 Eclipse开发 Web 应用程序.docx_第3页
第3页 / 共20页
计算机专业文献翻译用 Tomcat 和 Eclipse开发 Web 应用程序.docx_第4页
第4页 / 共20页
计算机专业文献翻译用 Tomcat 和 Eclipse开发 Web 应用程序.docx_第5页
第5页 / 共20页
点击查看更多>>
下载资源
资源描述

计算机专业文献翻译用 Tomcat 和 Eclipse开发 Web 应用程序.docx

《计算机专业文献翻译用 Tomcat 和 Eclipse开发 Web 应用程序.docx》由会员分享,可在线阅读,更多相关《计算机专业文献翻译用 Tomcat 和 Eclipse开发 Web 应用程序.docx(20页珍藏版)》请在冰豆网上搜索。

计算机专业文献翻译用 Tomcat 和 Eclipse开发 Web 应用程序.docx

计算机专业文献翻译用Tomcat和Eclipse开发Web应用程序

DevelopingWebapplicationswithTomcatandEclipse

Requiredcomponents

TheEclipseV3.2Callistointegrateddevelopmentenvironment(IDE)includestoolsfordoingWebdevelopmentandintegratingwithservers.So,asidefromthesoftwaredevelopmentkit(SDK),youneedonlyEclipseandApacheTomcatinstalled.Theversionsfeaturedinthisarticlearelistedbelow.

Table1.Componentsandversionsused

Component

Versionusedinthisarticle

EclipsePlatform

3.2.2

JavaEE5SDK

1.5.0_09

ApacheTomcat

5.5.20

TheEclipseIDEisanopensourceIDEusedasthedevelopmentenvironmentforyourJava™ServerPages(JSPs)andJavafiles.WiththeWebandJava2Platform,EnterpriseEdition(J2EE)Developmenttoolsinstalled,EclipseisgreattoolforcreatingHTML,JSPs,andservlets.

YouneedtheJavaSDKtorunservletsonyourmachine.Finally,ApacheTomcatisanopensourceWebandservletcontainer,usedintheofficialreferenceimplementationsforJavaServletandJavaServerPages.

Installation

InstallationofEclipseandTomcatissimilar—bothareextractedfromthearchivefileformatintoafolderonyourharddisk.Ifyoueverwanttouninstalleither,it'sassimpleasdeletingthedirectoryinwhichyouextractedthefiles.

InstallEclipse

ToinstalltheEclipseIDE,unpackthecompressed(.zipor.tar.gz)fileyoudownloadedfromEclipse,thenmovetheunpackedfolderintoaconvenientlocation.ItrytoinstallitinalocationthatfollowstheconventionsofwhateveroperatingsystemI'musing.IfI'minstallingEclipseonaMacintosh,IputtheEclipsefolderintheApplicationsfolder.IfI'musingMicrosoft™Windows™,IputtheunpackedfolderintotheC:

\ProgramFilesdirectory.

Onceyou'vedownloadedandinstalledEclipse,startitup.BeforeyoucancreateaWebproject,youneedtoinstalltheJ2EEandWebDevelopmentplug-ins.Fortunately,it'seasytoinstalltheplug-inusingtheCallistoDiscoverySite.

InstalltheWebtools

WiththeEclipseIDErunning,selectHelp>SoftwareUpdates>FindandInstall.ThisoptionletsyoudownloadandinstalltheWebtoolswithoutgoingtoaWebsite.

SelectSearchforNewFeaturestoInstall,asshownbelow,thenclickNext.

Figure1.Install/Updatewindow

SelectCallistoDiscoverySite,asshownbelow,thenclickNext.

Figure2.SelecttheCallistoDiscoverySite

UnderCallistoDiscoverySite,checktheWebandJ2EEDevelopmentbox.Thewizardimmediatelywarnsyouthatyou'remissingdependencies.ClickSelectRequired,andthesewarningsshoulddisappear.SomeorallofthecomponentsintheGraphicalEditorsandFrameworksandModelsandModelDevelopmentcategoriesareselected(asshowninFigure3)becausethey'rerequiredfortheinstallationoftheWebandJ2EEplug-ins.

Figure3.Selectfeaturesforinstallation

ClickNexttocontinue,andlicenseagreementsappearforeachfeatureyou'veselected.Ifyouagreewiththelicenses,acceptthemandfollowthewizardthroughtherestoftheprocess.WhentheIDEisfinishedinstallingtheplug-ins,itasksyoutorestartEclipseinorderforthechangestotakeeffect.BesureyourestarttheIDEbeforecontinuing.

AfteryourestarttheIDE,thenewfeaturesareavailabletobegindevelopingdynamicWebprojects.

InstallTomcat

ToinstallApacheTomcat,extractthefilesfromthedownloadedarchiveandplacethemintoadirectory.IputtheminmyC:

\appsdirectorytomakethemeasytolocatelater.That'sitfornow;useEclipseasshownlatertostartTomcat.

CreateanewWebproject

FromtheEclipseIDE,selectFile>New>Projecttoviewtheprojectwizards.TypeWebintheWizardsbox,andtheNewProjectwindowfiltersthewizardstoshowtheonesthatmatch.Thisisaneasywaytolocatethewizardyouwantinsteadofgoingthrougheachitem.

ChooseDynamicWebProjectfromthelist.YouusetheStandardWebProjectWizardtomakestaticHTMLWebprojects.YoucantechnicallyuseTomcattorunstaticWebsites,althoughaWebserversuchasApacheWebServermaybeabetterchoiceforstaticcontent.Webserversbuiltspecificallyforservingupstaticpagestendtohavelessoverheadandaretunedforthatpurpose.

Targetaruntime

UnderTargetRuntime,yousee,asshowninFigure4,becauseyouhaven'tcreatedaruntimeyetforApacheTomcat.ClickNewtoopentheNewTargetRuntimeWizard.SelectApacheTomcatV5.5fromtheApachefolder,asshowninFigure5,thenclickNext.

Figure4.CreateanewdynamicWebproject

Figure5.Createanewserverruntime

Nowyouhavetheopportunitytonameyourruntime,althoughthedefaultnameApacheTomcatV5.5isfine.ClickBrowsetolocatethebasefolderforyourApacheTomcatconfiguration(mineisC:

\apps\apache-tomcat-5.5.20,asshowninFigure6).IrecommendleavingtheIBM®JavaRuntimeEnvironment(JRE)versionthesameas

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

当前位置:首页 > 幼儿教育 > 幼儿读物

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

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