计算机类外文翻译.pdf
《计算机类外文翻译.pdf》由会员分享,可在线阅读,更多相关《计算机类外文翻译.pdf(10页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、外文原文Introducing JSP、JAVA、TomcatBy:Gary H.Sockut,Balakrishna R.IyerSource:Beginning JSP,JSF and TomcatIntroducing JSP and TomcatInteractivity is what makes the Web really useful.By interacting with a remote server,you can findthe information you need,keep in touch with your friends,or purchase someth
2、ingonline.And everytime you type something into a web form,an application“out there”interprets your request and prepares a web page to respond.1.Installing JavaJavaServer Pages(JSP)is a technology that helps you create such dynamically generatedpages by converting script files into executable Java m
3、odules;JavaServer Faces(JSF)is apackage that facilitates interactivity with the page viewers;and Tomcat is an application thatcan execute your code and act as a web server for your dynamic pages.Everything you need to develop JSP/JSF web applications is available for free downloadfrom the Internet;b
4、ut to install all the necessary packages and tools and obtain an integrateddevelopment environment,you need to proceed with care.There is nothing more annoyingthan having to deal with incorrectly installed software.When something doesnt work,theproblem will always be difficult to find.In this chapte
5、r,Ill introduce you to Java servlets and JSP,and Ill show you how theywork together within Tomcat to generate dynamic web pages.But,first of all,I will guide youthrough the installation of Java and Tomcat:there wouldnt be much point in looking at codeyou cant execute on your PC,would there?Youll hav
6、e to install more packages as you progress.Do these installations correctly,and you will never need to second guess yourself.In total,you will need at least 300MB ofdisk space for Java and Tomcat alone and twice as much space to install the Eclipsedevelopment environment.To run all the examples cont
7、ained in this book,I used a PC with a2.6GHz AMD Athlon 64x2(nothing fancy,nowadays)with 1GB of memory and runningWindows Vista SP2.Before performing any installation,I reformatted the hard disk andre-installed the OS from the original DVD.I dont suggest for a moment that you do the same!I did it for
8、 two opposite butequally important reasons:first,I didnt want existing stuff tointerfere with the latest packages needed for web development;second,I didnt want to relyon anything already installed.I wanted to be sure to give you the full list of what you need.12.Installing TomcatThis is the Java we
9、b server,which is the servlet container that allows you to run JSP.Ifyou have already installed an older version of Tomcat,you should remove it before installinga new version.Tomcat listens to three communication ports of your PC(8005,8009,and 8080).Beforeyou install Tomcat,you should check whether
10、some already-installed applications arelistening to one or more of those ports.To do so,open a DOS window and type the commandnetstat/a.It will display a list of active connections in tabular form.The second column of thetable will look like this:Local Address0.0.0.0:1350.0.0.0:4450.0.0.0:3306The po
11、rt numbers are the numbers after the colon.If you see one or more of the portsTomcat uses,after installing Tomcat,you will have to change the ports it listens to.Heres howto install Tomcat 7 correctly:(1).Go to the URL http:/tomcat.apache.org/download-70.cgi.Immediatelybelow the second heading(“Quic
12、k Navigation”),you will see four links:KEYS,7.0.26,Browse,and Archives.(2).By clicking on 7.0.26,you will be taken toward the bottom of the same page to aheading with the same version number.Below the version heading,you will see thesubheading“Core”.Below that,immediately above the next subheading,y
13、ou will see threelinks arranged as follows:32-bit/64-bit Windows Service Installer(pgp,md5).(3).Clickon32-bit/64-bitWindowsServiceInstallertodownloadthefile:apache-tomcat-7.0.26.exe(8.2 MB).(4).Before launching the installer file,you have to check its integrity.To do so,you needa small utility to ca
14、lculate its checksum.There are several freely available on the Internet.Idownloaded WinMD5Free from http:/ it worked for me,but thisdoesnt mean I consider it better than any other similar utility.It just h appened to be the firstone I saw.The program doesnt require any special installation:just unzi
15、p it and launch.When you open the Tomcat installer file,you will see a 32-digit hexadecimalnumber verymuch like this:8ad7d25179168e74e3754391cdb24679.(5).Go back to the page from which you downloaded the Tomcat installer and click onthe md5 link(the third one,and second within the parentheses).This
16、will open a page2containing a single line of text,like this:8ad7d25179168e74e3754391cdb24679*apache-tomcat-7.0.26.exeIf the hex string is identical to that calculated by the checksum utility,you know that theversion of Tomcat installer you have downloaded has not been corrupted or modified in anyway
17、.(6).Now that you have verified the correctness of the Tomcat installer,launch it.(7).After youve agreed to the terms of the license,you will then see the dialog shown inFigure 1-5.Click on the plus sign before the Tomcat item and select“Service”and“Native”as shown in the figure before clicking on t
18、he“Next”button.(8).I chose to install Tomcat in the directory“C:Program FilesApache SoftwareFoundationTomcat”instead of the default“Tomcat 7.0”.This is because sometimes youmight like to point to this directory(normally referred to as%CATALINA_HOME%)fromwithin a program,and one day you might replace
19、 Tomcat 7.0 with Tomcat 8.0.By callingTomcats home directory“Tomcat”you are“safe”for years to come.You can also decide toleave the default.In general,by using the defaults,you are likely to encounter fewer problems,because the default settings of any applications are always tested best!(9).Next,the
20、Tomcat installer will ask you to specify the connector port and UserID pluspassword for the administrator login.Leave the port set to 8080,because all the examples inthis book refer to port 8080.If you want,you can always change it later to the HTTP standardport(which is 80).As UserID/Password,you m
21、ight as well use your Windows user name andpassword.It is not critical.(10).Lastly,you will need to provide the path of a Java Runtime Environment.This is thepath you saw when installing Java(see previous section).With the version of Java I installed,the correct path is C:Program FilesJavajre7.3.Wha
22、t is JSPJSP is a technology that lets you add dynamic content to web pages.In absence of JSP,toupdate the appearance or the content of plain static HTML pages,you always have to do it byhand.Even if all you want to do is change a date or a picture,you must edit the HTML fileand type in your modifica
23、tions.Nobody is going to do it for you,whereas with JSP,you canmake the content dependent on many factors,including the time of the day,the informationprovided by the user,the users history of interaction with your web site,and even the usersbrowser type.This capability is essential to provide onlin
24、e services in which you can tailoreach response to the viewer who made the request,depending on the viewers preferences andrequirements.A crucial aspect of providing meaningful online services is for the system to be3able to remember data associated with the service and its users.Thats why databases
25、 play anessential role in dynamic web pages.But lets take it one step at a time.Sun Microsystems introduced JSP in 1999.Developers quickly realized that additionaltags would be useful,and the JSP Standard Tag Library(JSTL)was born.JSTL is a collectionof custom tag libraries that encapsulates the fun
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机 外文 翻译
限制150内