版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、<p><b> 外文資料翻譯</b></p><p> 資料來(lái)源:www.InfoQ.com</p><p> 文章名:JSP And WEB Technology</p><p> 書(shū)刊名:《Communications Technology》</p><p> 作 者:Damon Hougla
2、nd, Aaron Tavistock</p><p> 出版社:InfoQ,2010.3</p><p> 章 節(jié):Chapter3</p><p> 頁(yè) 碼:P34~P45</p><p> 文 章 譯 名: JSP及其WEB技術(shù) </p><p> 姓
3、 名: </p><p> 學(xué) 號(hào): </p><p> 指導(dǎo)教師(職稱): </p><p> 專 業(yè): 計(jì)算機(jī)科學(xué)與技術(shù)(工程方向) </p><p> 班
4、 級(jí): </p><p> 所 在 學(xué) 院: 計(jì)算機(jī)科學(xué)與工程學(xué)院 </p><p><b> 外文原文:</b></p><p> JSP and WEB technology </p><p> 1 JSP Intr
5、oduction</p><p> JSP (JavaServer Pages) is a Java-based scripting technology. Is advocated by Sun Microsystems Inc., together with a number of companies involved in the establishment of a dynamic web page t
6、echnology standards. JSP technology is somewhat similar to ASP technology, It is a traditional HTML page file (*. htm, *. html) to insert Java program segment (Scriptlet) and JSP tag (tag), To form the JSP file(*jsp). We
7、b development with JSP is a cross-platform applications that can run under Linux, but also </p><p> The Web server when meets visits the JSP homepage the request, first carries out segment, will then carry
8、out the result code to return together with JSP in the document HTML for the customer. The insertion Java segment may operate the database, again the directional homepage and so on, realizes the function which the establ
9、ishment dynamic homepage needs. JSP and Java Servlet are the same, is in the server end execution, usually returns to this client side is a HTML text, therefore client side, </p><p> The JSP page is compose
10、d of the HTML code and the inserting Java code. The server in the page by the client side was requested that later will carry on processing to these Java code, will then produce the HTML page will return gives the client
11、 side the browser. Java Servlet is the JSP technology base, moreover the large-scale Web application procedure's development needs Java Servlet and the JSP coordination can complete. JSP had the Java technology simpl
12、y easy to use, complete object-oriented, </p><p> 2 JSP computing technique</p><p> To carry on the dynamic website conveniently fast the development, JSP has made the improvement in the follo
13、wing several aspects, causes it to become builds the cross platform fast the dynamic website first choice plan.</p><p> 2.1 carries on the content production and the demonstration separates</p><p
14、> With the JSP technology, the Web page development personnel may use HTML or the XML marking design and the formatted final page, and uses the JSP marking or the tootsy produces on page's dynamic content origina
15、lly. Production content's logic is sealed in marks and in the JavaBeans module, and ties up in the script, all scripts in server end movement. Because core logic is sealed in marks and in JavaBeans, therefore the Web
16、 administrative personnels and the page designer, can edit and use the JSP</p><p> 2.2 may entrust with heavy responsibility the module</p><p> The overwhelming majority JSP page relies on may
17、 entrust with heavy responsibility, the cross platform module (JavaBeans or Enterprise the JavaBeans module) carries out complex processing which the application procedure requests. The development personnel can share an
18、d exchange the execution ordinary operation the module, or causes these modules uses for more users and the customer association. Has accelerated the overall development process based on module's method, and causes e
19、ach kind of orga</p><p> 2.3 uses marking</p><p> The Web page development personnel will not be the familiar script language programmers. The JSP technology has sealed many functions, these f
20、unctions are easy to use, marking to carry on the dynamic content production with JSP in the related XML to need. The standard JSP marking can visit and the instantiation JavaBeans module, the establishment or the retrie
21、val module attribute, downloads Applet, as well as the execution difficulty with codes and the time-consuming function with other methods.</p><p> 2.4 adapts the platform</p><p> Nearly all pl
22、atforms support Java, JSP+JavaBeans to be possible to pass unimpeded nearly under all platforms. Transplants from a platform to other platform, JSP and JavaBeans does not even need to translate, because the Java byte cod
23、e is standard has nothing to do with the platform.</p><p> 2.5 database connection</p><p> In Java connects the database the technology is the JDBC, Java procedure is connected through the JDB
24、C driver and the database, operations and so on execution inquiry, extraction data. Sun Corporation has also developed JDBC-ODBC bridge, uses this technical Java procedure to be possible to visit has the ODBC driver data
25、base, at present the majority database systems have the ODBC driver, therefore the Java procedure can visit such as Oracle, Sybase, MS SQL Server and databases and so on MS Access</p><p> 3 Eclipse function
26、 synopsis</p><p> More and more Java development personnel already started the productivity which and the quality income appreciates Eclipse JDT to provide. It was the Java editor provides grammar Gao Liang
27、 to demonstrate that the formatting, the fold, the content were auxiliary, code template and so on many functions. It grows unceasingly available restructuring and the code generation function set permits you in a higher
28、 rank the operation code, and automated usual code intensity duty and easy wrong duty. Moreo</p><p> Eclipse by a script level constitution, contains in many functional modules or the Eclipse terminology so
29、-called “the plug-in unit”. The plug-in unit is provides all functions in the Eclipse application procedure the module. They cooperate through its API to pay the final outcome together. In Eclipse, even the most foundati
30、on's function, for instance the search and the start installment's plug-in unit, seals in the plug-in unit. In order to expand the existing Eclipse function or carry on the co</p><p> May see that t
31、he modular construction was Eclipse has provided the huge flexibility, and provided one to be possible to support the massive application procedure platform which the original design has not expected.</p><p>
32、; 4 Structs function synopsis</p><p> Struts is a MVC frame (Framework), uses in developing Java fast the Web application. Struts realizes the key point in C(Controller), Action which and we have custom-ma
33、de including ActionServlet/RequestProcessor, was also V(View) provides a series of rows to have custom-made the label (Custom Tag). Spring is a light vessel (light-weight container), its core is the Bean factory (Bean Fa
34、ctory), with constructs M(Model) which we need. Above this foundation, Spring has provided AOP (Aspect-Oriented P</p><p> Structs is the kind which, servlet and the JSP mark a group cooperates mutually, the
35、y compose the MVC 2 designs which may entrust with heavy responsibility. This definition expressed that Struts is a frame, but is not a storehouse, but Struts has also contained the rich mark storehouse and the independe
36、nce in this frame work utility program class.</p><p> Client browser (customer browser), the request founds an event from customer browser's each HTTP. The Web vessel will use a HTTP response to make th
37、e response.</p><p> Controller (controller), the controller receive from browser's request, and decided that sends out where this request. Speaking of Struts, the controller is an order design pattern w
38、hich realizes by servlet. struts-config.xml document disposition controller. </p><p> Service logic, the service logic renewal model's condition, and helps the control application procedure the flow. Sp
39、eaking of Struts, this is through takes the actual service logic “thin” the packing Action kind to complete.</p><p> Model (model) condition, model expression application procedure condition. Service object
40、 renewal application procedure condition. ActionForm bean in conversation level or request level expression model condition, but is not in the lasting level. The JSP document uses JSP to mark the read from the ActionForm
41、 bean information.</p><p> View (view), the view is a JSP document. And does not have the flow logic, does not have the service logic, also does not have the model information -- Only then marks. The mark c
42、auses Struts is different with other frames (for example Velocity) one of factors.</p><p> Just like the Struts controller is (event usually is HTTP post) maps the event kind of servlet. you to expect - the
43、 air-operated controller use configuration files to cause you not to need to carry on to these values the hard code. The time has changed, but method as before.</p><p> The Action kind, ActionForm maintains
44、 the Web application procedure the conversation condition. ActionForm is one abstract class, must found this kind of subclass for each input form model. When I said when input form model, what refers to the ActionForm ex
45、pression is establishes or in the renewal general sense data by the HTML form.The Action kind is service logic packing. A Action kind of use is transforms HttpServletRequest into the service logic. Must use Action, pleas
46、e found its subclass an</p><p> ActionServlet (Command) will use perform () the method the parametrization kind to transmit for ActionForm. Still did not have too many repugnant request.getParameter () to t
47、ransfer. When the event progresses to this step, the input form data (or HTML form data) has been withdrawn from the request class and shifts to the ActionForm kind.</p><p> Considered that a Action kind of
48、 another way is the Adapter design pattern. The Action use will be “a kind of connection will transform another connection which will need for the client. Adapter enables the kind the joint operation, if does not have Ad
49、apter, then these kinds will be unable because of the incompatible connection the joint operation.”. In this example's client is ActionServlet, it knows nothing about to our concrete service class connection. Therefo
50、re, Struts has provided a servic</p><p> 5 CSS synopsis</p><p> The CSS edition method is the same with HTML, may also be any text editor or the homepage edition software, but also has uses fo
51、r to edit CSS specially the software. If you write the CSS sentence regards the exterior cascading style sheet, but transfers in the HTML document, then its extension saves .css to be possible. Initially the technical pe
52、rsonnel found out HTML, mainly stresses on the definition content, for instance expressed that a paragraph, indicates the title, but excessively has not</p><p> Along with the Internet rapid development, HT
53、ML is widely applied, the surfer people hoped certainly that the homepage makes attractive, therefore the HTML typesetting and the contact surface effect's limitation exposes day by day. In order to solve this proble
54、m, the people also took many tortuous paths, has used some not good method, for instance increases many attribute results to HTML becomes the code very extremely fat, turns the picture the text, excessively many comes th
55、e typesetting using</p><p> CSS may be a homepage design breakthrough, it has solved the homepage contact surface typesetting difficult problem. May such say that HTML Tag is mainly defines the homepage con
56、tent (Content), but CSS decided how these homepage content does demonstrate (Layout). The CSS English is Cascading Style Sheets, Chinese may translate the tandem cascading style sheet. CSS may divide into three kinds acc
57、ording to its position: In inlays the style (Inline Style), internal cascading style sheet (Internal S</p><p> 6 Js script language synopsis</p><p> JS is javascrip, Javascript is one kind the
58、 script language which comes by the Netscape LiveScript development, the main purpose is to solve the server terminal language, for instance Perl, carry-over speed question. At that time served the end to need to carry o
59、n the confirmation to the data, because the network speed was quite slow, only then 28.8kbps, the confirmation step waste's time were too many. Therefore Netscape browser Navigator has joined Javascript, has provided
60、 the data confirmatio</p><p> The JavaScript official name is “ECMAScript”. This standard by ECMA organization development and maintenance. ECMA-262 is the official JavaScript standard. This standard based
61、on JavaScript (Netscape) and JScript (Microsoft). Netscape (Navigator 2.0) Brendan Eich has invented this language, started from 1996, already appeared in all Netscape and in the Microsoft browser. The ECMA-262 developme
62、nt began in 1996, in 1997 July, the ECMA general meeting has accepted its first edition.</p><p> Script script uses one specific descriptive language, rests on certain form compilation to be possible the ex
63、ecution document, is also called as great or the batch run document. The script usually may transfer temporarily by the application procedure and carry out. Each kind of script present widely is applied in the homepage d
64、esign, because the script not only may reduce the home page the scale and raises the homepage browsing speed, moreover may enrich the homepage performance, like animation,</p><p> Present's script langu
65、age is quite many, script language execution generally only with concrete explanation actuator related, so long as therefore on the system has the corresponding language interpreter to be possible to achieve the cross pl
66、atform. Script (Script), is includes order and so on bind and alias sets, you may save this set are an independent document then in the time which needs carries out, like this may facilitate you in the CS use. The script
67、 may save for the suffix named .cfg do</p><p> JSP及其WEB技術(shù)</p><p><b> 譯文:</b></p><p><b> 1 JSP簡(jiǎn)介</b></p><p> JSP(JavaServer Pages)是一種基于Java的腳
68、本技術(shù)。是由Sun Microsystems公司倡導(dǎo)、許多公司參與一起建立的一種動(dòng)態(tài)網(wǎng)頁(yè)技術(shù)標(biāo)準(zhǔn)。JSP技術(shù)有點(diǎn)類似ASP技術(shù),它是在傳統(tǒng)的網(wǎng)頁(yè)HTML文件(*.htm,*.html)中插入Java程序段(Scriptlet)和JSP標(biāo)記(tag),從而形成JSP文件(*.jsp)。用JSP開(kāi)發(fā)的Web應(yīng)用是跨平臺(tái)的,即能在Linux下運(yùn)行,也能在其他操作系統(tǒng)上運(yùn)行。在JSP 的眾多優(yōu)點(diǎn)之中,其中之一是它能將 HTML 編碼從 Web
69、頁(yè)面的業(yè)務(wù)邏輯中有效地分離出來(lái)。用 JSP 訪問(wèn)可重用的組件,如 Servlet、JavaBean 和基于 Java 的 Web 應(yīng)用程序。JSP 還支持在 Web 頁(yè)面中直接嵌入 Java 代碼??捎脙煞N方法訪問(wèn) JSP 文件:瀏覽器發(fā)送 JSP 文件請(qǐng)求、發(fā)送至 Servlet 的請(qǐng)求。JSP技術(shù)使用Java編程語(yǔ)言編寫(xiě)類XML的tags和scriptlets,來(lái)封裝產(chǎn)生動(dòng)態(tài)網(wǎng)頁(yè)的處理邏輯。網(wǎng)頁(yè)還能通過(guò)tags和scriptlets
70、訪問(wèn)存在于服務(wù)端的資源的應(yīng)用邏輯。JSP將網(wǎng)頁(yè)邏輯與網(wǎng)頁(yè)</p><p> Web服務(wù)器在遇到訪問(wèn)JSP網(wǎng)頁(yè)的請(qǐng)求時(shí),首先執(zhí)行其中的程序段,然后將執(zhí)行結(jié)果連同JSP文件中的HTML代碼一起返回給客戶。插入的Java程序段可以操作數(shù)據(jù)庫(kù)、重新定向網(wǎng)頁(yè)等,以實(shí)現(xiàn)建立動(dòng)態(tài)網(wǎng)頁(yè)所需要的功能。JSP與Java Servlet一樣,是在服務(wù)器端執(zhí)行的,通常返回該客戶端的就是一個(gè)HTML文本,因此客戶端只要有瀏覽器就能瀏覽。
71、</p><p> JSP頁(yè)面由HTML代碼和嵌入其中的Java代碼所組成。服務(wù)器在頁(yè)面被客戶端請(qǐng)求以后對(duì)這些Java代碼進(jìn)行處理,然后將生成的HTML頁(yè)面返回給客戶端的瀏覽器。Java Servlet 是JSP的技術(shù)基礎(chǔ),而且大型的Web應(yīng)用程序的開(kāi)發(fā)需要Java Servlet和JSP配合才能完成。JSP具備了Java技術(shù)的簡(jiǎn)單易用,完全的面向?qū)ο?,具有平臺(tái)無(wú)關(guān)性且安全可靠,主要面向因特網(wǎng)的所有特點(diǎn)。<
72、;/p><p> 2 JSP技術(shù)方法 </p><p> 為了快速方便地進(jìn)行動(dòng)態(tài)網(wǎng)站的開(kāi)發(fā),JSP在以下幾個(gè)方面做了改進(jìn),使其成為快速建立跨平臺(tái)的動(dòng)態(tài)網(wǎng)站的首選方案。</p><p> 2.1 將內(nèi)容的生成和顯示進(jìn)行分離</p><p> 用JSP技術(shù),Web頁(yè)面開(kāi)發(fā)人員可以使用HTML或者XML標(biāo)識(shí)來(lái)設(shè)計(jì)和格式化最終頁(yè)面,并使用JSP
73、標(biāo)識(shí)或者小腳本來(lái)生成頁(yè)面上的動(dòng)態(tài)內(nèi)容。生成內(nèi)容的邏輯被封裝在標(biāo)識(shí)和JavaBeans組件中,并且捆綁在腳本中,所有的腳本在服務(wù)器端運(yùn)行。由于核心邏輯被封裝在標(biāo)識(shí)和JavaBeans中,所以Web管理人員和頁(yè)面設(shè)計(jì)者,能夠編輯和使用JSP頁(yè)面,而不影響內(nèi)容的生成。在服務(wù)器端,JSP引擎解釋JSP標(biāo)識(shí)和腳本,生成所請(qǐng)求的內(nèi)容,并且將結(jié)果以HTML(或者XML)頁(yè)面的形式發(fā)送回瀏覽器。這既有助于作者保護(hù)自己的代碼,又能保證任何基于HTML的W
74、eb瀏覽器的完全可用性。</p><p><b> 2.2 可重用組件</b></p><p> 絕大多數(shù)JSP頁(yè)面依賴于可重用的、跨平臺(tái)的組件(JavaBeans或者Enterprise JavaBeans組件)來(lái)執(zhí)行應(yīng)用程序所要求的復(fù)雜的處理。開(kāi)發(fā)人員能夠共享和交換執(zhí)行普通操作的組件,或者使得這些組件為更多的使用者和客戶團(tuán)體所使用?;诮M件的方法加速了總體開(kāi)發(fā)
75、過(guò)程,并且使得各種組織在他們現(xiàn)有的技能和優(yōu)化結(jié)果的開(kāi)發(fā)努力中得到平衡。</p><p><b> 2.3 采用標(biāo)識(shí)</b></p><p> Web頁(yè)面開(kāi)發(fā)人員不會(huì)都是熟悉腳本語(yǔ)言的編程人員。JSP技術(shù)封裝了許多功能,這些功能是在易用的、與JSP相關(guān)的XML標(biāo)識(shí)中進(jìn)行動(dòng)態(tài)內(nèi)容生成所需要的。標(biāo)準(zhǔn)的JSP標(biāo)識(shí)能夠訪問(wèn)和實(shí)例化JavaBeans組件,設(shè)置或者檢索組件屬性
76、,下載Applet,以及執(zhí)行用其他方法更難于編碼和耗時(shí)的功能。</p><p><b> 2.4 適應(yīng)平臺(tái)</b></p><p> 幾乎所有平臺(tái)都支持Java,JSP+JavaBeans幾乎可以在所有平臺(tái)下通行無(wú)阻。從一個(gè)平臺(tái)移植到另外一個(gè)平臺(tái),JSP和JavaBeans甚至不用重新編譯,因?yàn)镴ava字節(jié)碼都是標(biāo)準(zhǔn)的與平臺(tái)無(wú)關(guān)的。</p><
77、p><b> 2.5 數(shù)據(jù)庫(kù)連接</b></p><p> Java中連接數(shù)據(jù)庫(kù)的技術(shù)是JDBC,Java程序通過(guò)JDBC驅(qū)動(dòng)程序與數(shù)據(jù)庫(kù)相連,執(zhí)行查詢、提取數(shù)據(jù)等操作。Sun公司還開(kāi)發(fā)了JDBC-ODBC bridge,利用此技術(shù)Java程序可以訪問(wèn)帶有ODBC驅(qū)動(dòng)程序的數(shù)據(jù)庫(kù),目前大多數(shù)數(shù)據(jù)庫(kù)系統(tǒng)都帶有ODBC驅(qū)動(dòng)程序,所以Java程序能訪問(wèn)諸如Oracle、Sybase、MS
78、 SQL Server和MS Access等數(shù)據(jù)庫(kù)。此外,通過(guò)開(kāi)發(fā)標(biāo)識(shí)庫(kù),JSP技術(shù)可以進(jìn)一步擴(kuò)展。第三方開(kāi)發(fā)人員和其他人員可以為常用功能創(chuàng)建自己的標(biāo)識(shí)庫(kù)。這使得Web頁(yè)面開(kāi)發(fā)人員能夠使用熟悉的工具和如同標(biāo)識(shí)一樣的執(zhí)行特定功能的構(gòu)件來(lái)進(jìn)行工作。JSP技術(shù)很容易整合到多種應(yīng)用體系結(jié)構(gòu)中,以利用現(xiàn)存的工具和技巧,并且能擴(kuò)展到支持企業(yè)級(jí)的分布式應(yīng)用中。</p><p> 3 Eclipse功能簡(jiǎn)介</p>
79、<p> 越來(lái)越多的Java開(kāi)發(fā)人員已經(jīng)開(kāi)始欣賞Eclipse的JDT提供的生產(chǎn)率和質(zhì)量收益。它為Java編輯器提供了語(yǔ)法高亮顯示、格式化、折疊、內(nèi)容輔助、代碼模板等許多功能。它不斷增長(zhǎng)的可用重構(gòu)和代碼生成功能集合允許您在更高的級(jí)別上操作代碼,并自動(dòng)化通常的代碼密集型任務(wù)和易錯(cuò)任務(wù)。而且,在開(kāi)發(fā)完代碼并使用JDT對(duì)編寫(xiě)和執(zhí)行JUnit測(cè)試的內(nèi)置支持對(duì)代碼進(jìn)行單元測(cè)試之后,可以使用Eclipse的一流Java調(diào)試器調(diào)試在運(yùn)
80、行時(shí)遇到的任何問(wèn)題。除了JDT之外,Eclipse SDK—最流行的Eclipse.org下載—還包含Plug-in Development Environment(PDE)。PDE使用特定功能擴(kuò)展了JDT以構(gòu)建Eclipse插件—基于Eclipse的應(yīng)用程序的基本構(gòu)造塊。事實(shí)上,使用由Eclipse本身提供的工具能夠超越Java開(kāi)發(fā),可擴(kuò)展現(xiàn)有Eclipse應(yīng)用程序,或者甚至創(chuàng)建全新的應(yīng)用程序。</p><p>
81、; Eclipse由一個(gè)小程序?qū)訕?gòu)成,其中包含許多功能模塊或Eclipse術(shù)語(yǔ)中所謂的“插件”。插件是在Eclipse應(yīng)用程序中提供所有功能的組件。它們通過(guò)其API一起協(xié)作來(lái)交付最終結(jié)果。在Eclipse中,甚至最基礎(chǔ)的功能,比如查找和啟動(dòng)安裝的插件,都封裝在插件中。為了擴(kuò)展現(xiàn)有Eclipse功能或在其上進(jìn)行構(gòu)建,插件將具體的擴(kuò)展貢獻(xiàn)給由其他插件暴露的擴(kuò)展點(diǎn)。通常,插件專注于特定區(qū)域的責(zé)任,并通過(guò)一個(gè)或多個(gè)擴(kuò)展點(diǎn)的方式將其他責(zé)任指派給
82、其他插件。例如,一個(gè)插件允許您可視地并行比較兩個(gè)文件的內(nèi)容,但它不會(huì)關(guān)心如何讀取這些文件甚至如何解釋這些文件的結(jié)構(gòu);這是其他插件的工作。比較兩個(gè)文件時(shí),該插件首先檢查是否有另一個(gè)插件可以解釋這些文件的結(jié)構(gòu)。如果找到一個(gè),它就會(huì)向找到的插件詢問(wèn)有關(guān)文件結(jié)構(gòu)的信息,并在比較過(guò)程中使用該信息。</p><p> 可以看到,模塊化架構(gòu)為Eclipse提供了巨大的靈活性,并提供了一個(gè)可以支持原設(shè)計(jì)者沒(méi)有預(yù)料到的大量應(yīng)用程
83、序的平臺(tái)。</p><p> 4 Structs功能簡(jiǎn)介</p><p> Struts是一個(gè)MVC框架(Framework),用于快速開(kāi)發(fā)Java Web應(yīng)用。Struts實(shí)現(xiàn)的重點(diǎn)在C(Controller),包括ActionServlet/RequestProcessor和我們定制的Action,也為V(View)提供了一系列定制標(biāo)簽(Custom Tag)。Spring是一個(gè)輕
84、型容器(light-weight container),其核心是Bean工廠(Bean Factory),用以構(gòu)造我們所需要的M(Model)。在此基礎(chǔ)之上,Spring提供了AOP(Aspect-Oriented Programming, 面向?qū)用娴木幊蹋┑膶?shí)現(xiàn),用它來(lái)提供非管理環(huán)境下申明方式的事務(wù)、安全等服務(wù);對(duì)Bean工廠的擴(kuò)展ApplicationContext更加方便我們實(shí)現(xiàn)J2EE的應(yīng)用;DAO/ORM的實(shí)現(xiàn)方便我們進(jìn)行數(shù)據(jù)
85、庫(kù)的開(kāi)發(fā);Web MVC和Spring Web提供了Java Web應(yīng)用的框架或與其他流行的Web框架進(jìn)行集成。就是說(shuō)可將兩者一起使用,達(dá)到將兩者自身的特點(diǎn)進(jìn)行互補(bǔ)。</p><p> Structs 是一組相互協(xié)作的類、servlet 和 JSP 標(biāo)記,它們組成一個(gè)可重用的 MVC框架。這個(gè)定義表示 Struts 是一個(gè)框架,而不是一個(gè)庫(kù),但 Struts 也包含了豐富的標(biāo)記庫(kù)和獨(dú)立于該框架工作的實(shí)用程序類。
86、</p><p> Client browser(客戶瀏覽器),來(lái)自客戶瀏覽器的每個(gè) HTTP 請(qǐng)求創(chuàng)建一個(gè)事件。Web 容器將用一個(gè) HTTP 響應(yīng)作出響應(yīng)?! ?lt;/p><p> Controller(控制器),控制器接收來(lái)自瀏覽器的請(qǐng)求,并決定將這個(gè)請(qǐng)求發(fā)往何處。就 Struts 而言,控制器是以 servlet 實(shí)現(xiàn)的一個(gè)命令設(shè)計(jì)模式。 struts-config.xml 文件
87、配置控制器。</p><p> 業(yè)務(wù)邏輯,業(yè)務(wù)邏輯更新模型的狀態(tài),并幫助控制應(yīng)用程序的流程。就 Struts 而言,這是通過(guò)作為實(shí)際業(yè)務(wù)邏輯“瘦”包裝的 Action 類完成的。</p><p> Model(模型)的狀態(tài),模型表示應(yīng)用程序的狀態(tài)。業(yè)務(wù)對(duì)象更新應(yīng)用程序的狀態(tài)。ActionForm bean 在會(huì)話級(jí)或請(qǐng)求級(jí)表示模型的狀態(tài),而不是在持久級(jí)。JSP 文件使用 JSP 標(biāo)記讀
88、取來(lái)自 ActionForm bean 的信息。</p><p> View(視圖),視圖就是一個(gè) JSP 文件。其中沒(méi)有流程邏輯,沒(méi)有業(yè)務(wù)邏輯,也沒(méi)有模型信息 -- 只有標(biāo)記。標(biāo)記是使 Struts 有別于其他框架(如 Velocity)的因素之一。</p><p> Struts 的控制器是將事件(事件通常是 HTTP post)映射到類的一個(gè) servlet.正如您所料 —— 控
89、制器使用配置文件以使您不必對(duì)這些值進(jìn)行硬編碼。時(shí)代變了,但方法依舊。</p><p> Action類,ActionForm 維護(hù) Web 應(yīng)用程序的會(huì)話狀態(tài)。 ActionForm 是一個(gè)抽象類,必須為每個(gè)輸入表單模型創(chuàng)建該類的子類。當(dāng)我說(shuō) 輸入表單模型 時(shí),是指 ActionForm 表示的是由 HTML 表單設(shè)置或更新的一般意義上的數(shù)據(jù)。Action類是業(yè)務(wù)邏輯的一個(gè)包裝。 Action 類的用途是將 H
90、ttpServletRequest 轉(zhuǎn)換為業(yè)務(wù)邏輯。要使用 Action ,請(qǐng)創(chuàng)建它的子類并覆蓋 process()方法。</p><p> ActionServlet (Command) 使用 perform()方法將參數(shù)化的類傳遞給 ActionForm .仍然沒(méi)有太多討厭的 request.getParameter() 調(diào)用。當(dāng)事件進(jìn)展到這一步時(shí),輸入表單數(shù)據(jù)(或 HTML 表單數(shù)據(jù))已被從請(qǐng)求流中提取出
91、來(lái)并轉(zhuǎn)移到 ActionForm 類中。</p><p> 考慮 Action 類的另一種方式是 Adapter 設(shè)計(jì)模式。 Action 的用途是“將類的接口轉(zhuǎn)換為客戶機(jī)所需的另一個(gè)接口。Adapter 使類能夠協(xié)同工作,如果沒(méi)有 Adapter,則這些類會(huì)因?yàn)椴患嫒莸慕涌诙鵁o(wú)法協(xié)同工作?!薄1纠械目蛻魴C(jī)是 ActionServlet ,它對(duì)我們的具體業(yè)務(wù)類接口一無(wú)所知。因此,Struts 提供了它能夠理解
92、的一個(gè)業(yè)務(wù)接口,即 Action .通過(guò)擴(kuò)展 Action ,我們使得我們的業(yè)務(wù)接口與 Struts 業(yè)務(wù)接口保持兼容。</p><p><b> 5 CSS簡(jiǎn)介</b></p><p> CSS的編輯方法同HTML一樣,也可以是任何文本編輯器或網(wǎng)頁(yè)編輯軟件,還有專門用來(lái)編輯CSS的軟件。 如果你寫(xiě)的CSS語(yǔ)句是當(dāng)成外部樣式表而在HTML文件中調(diào)用,那它的擴(kuò)展名存
93、成.css就可。當(dāng)初技術(shù)人員想出HTML,主要側(cè)重于定義內(nèi)容,比如 p表示一個(gè)段落,h1表示標(biāo)題,而并沒(méi)有過(guò)多設(shè)計(jì)HTML的排版和界面效果。</p><p> 隨著Internet的迅猛發(fā)展,HTML被廣泛應(yīng)用,上網(wǎng)的人們當(dāng)然希望網(wǎng)頁(yè)做得漂亮些,因此HTML排版和界面效果的局限性日益暴露出來(lái)。為了解決這個(gè)問(wèn)題,人們也走了不少?gòu)澛?,用了一些不好的方法,比如給HTML增加很多的屬性結(jié)果將代碼變得很臃腫,將文本變成圖
94、片,過(guò)多利用Table來(lái)排版,用空白的圖片表示白色的空間等。直到CSS出現(xiàn)。</p><p> CSS可算是網(wǎng)頁(yè)設(shè)計(jì)的一個(gè)突破,它解決了網(wǎng)頁(yè)界面排版的難題??梢赃@么說(shuō),HTML的Tag主要是定義網(wǎng)頁(yè)的內(nèi)容(Content),而CSS決定這些網(wǎng)頁(yè)內(nèi)容如何顯示(Layout)。CSS的英文是Cascading Style Sheets,中文可以翻譯成串聯(lián)式樣式表。CSS按其位置可以分成三種:內(nèi)嵌樣式(Inline
95、Style) ,內(nèi)部樣式表(Internal Style Sheet) ,外部樣式表(External Style Sheet)。</p><p> 6 Js腳本語(yǔ)言簡(jiǎn)介</p><p> JS即javascrip,Javascript是一種由Netscape的LiveScript發(fā)展而來(lái)的腳本語(yǔ)言,主要目的是為了解決服務(wù)器終端語(yǔ)言,比如Perl,遺留的速度問(wèn)題。當(dāng)時(shí)服務(wù)端需要對(duì)數(shù)據(jù)進(jìn)
96、行驗(yàn)證,由于網(wǎng)絡(luò)速度相當(dāng)緩慢,只有28.8kbps,驗(yàn)證步驟浪費(fèi)的時(shí)間太多。于是Netscape的瀏覽器Navigator加入了Javascript,提供了數(shù)據(jù)驗(yàn)證的基本功能。</p><p> JavaScript 的正式名稱是 "ECMAScript"。這個(gè)標(biāo)準(zhǔn)由 ECMA 組織發(fā)展和維護(hù)。ECMA-262 是正式的 JavaScript 標(biāo)準(zhǔn)。這個(gè)標(biāo)準(zhǔn)基于 JavaScript (Ne
97、tscape) 和 JScript (Microsoft)。Netscape (Navigator 2.0) 的 Brendan Eich 發(fā)明了這門語(yǔ)言,從 1996 年開(kāi)始,已經(jīng)出現(xiàn)在所有的 Netscape 和 Microsoft 瀏覽器中。ECMA-262 的開(kāi)發(fā)始于 1996 年,在 1997 年 7 月,ECMA 會(huì)員大會(huì)采納了它的首個(gè)版本。</p><p> 腳本script是使用一種特定的描述性
98、語(yǔ)言,依據(jù)一定的格式編寫(xiě)的可執(zhí)行文件,又稱作宏或批處理文件。腳本通??梢杂蓱?yīng)用程序臨時(shí)調(diào)用并執(zhí)行。各類腳本目前被廣泛地應(yīng)用于網(wǎng)頁(yè)設(shè)計(jì)中,因?yàn)槟_本不僅可以減小網(wǎng)頁(yè)的規(guī)模和提高網(wǎng)頁(yè)瀏覽速度,而且可以豐富網(wǎng)頁(yè)的表現(xiàn),如動(dòng)畫(huà)、聲音等。舉個(gè)最常見(jiàn)的例子,當(dāng)我們點(diǎn)擊網(wǎng)頁(yè)上的E-mail地址時(shí)能自動(dòng)調(diào)用Outlook Express或Foxmail這類郵件軟件,就是通過(guò)腳本功能來(lái)實(shí)現(xiàn)的。也正因?yàn)槟_本的這些特點(diǎn),往往被一些別有用心的人所利用。例如在腳本
99、中加入一些破壞計(jì)算機(jī)系統(tǒng)的命令,這樣當(dāng)用戶瀏覽網(wǎng)頁(yè)時(shí),一旦調(diào)用這類腳本,便會(huì)使用戶的系統(tǒng)受到攻擊。所以用戶應(yīng)根據(jù)對(duì)所訪問(wèn)網(wǎng)頁(yè)的信任程度選擇安全等級(jí),特別是對(duì)于那些本身內(nèi)容就非法的網(wǎng)頁(yè),更不要輕易允許使用腳本。通過(guò)“安全設(shè)置”對(duì)話框,選擇“腳本”選項(xiàng)下的各種設(shè)置就可以輕松實(shí)現(xiàn)對(duì)腳本的禁用和啟用。</p><p> 現(xiàn)在的腳本語(yǔ)言是比較多的,一般的腳本語(yǔ)言的執(zhí)行只同具體的解釋執(zhí)行器有關(guān),所以只要系統(tǒng)上有相應(yīng)語(yǔ)言的解
100、釋程序就可以做到跨平臺(tái)。腳本(Script),就是含有bind和alias等命令的集合,你可以把這個(gè)集合存為一個(gè)獨(dú)立的文件然后在需要的時(shí)候執(zhí)行,這樣就可以方便你在CS中的使用。腳本可以存為后綴名為.cfg的文件放在cstrike文件夾下,執(zhí)行時(shí)在控制臺(tái)輸入:exec(腳本文件名).cfg即可。比如將一個(gè)腳本存為 buys.cfg文件,則在控制臺(tái)中輸入:execbuys.cfg則可以實(shí)現(xiàn)我們所需要的功能。要實(shí)現(xiàn)一個(gè)命令只要把這一過(guò)程定義(
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫(kù)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- jsp 外文翻譯--jsp及其web技術(shù)
- 外文翻譯--jsp及其web技術(shù)
- 外文翻譯--jsp及其web技術(shù)
- jsp 技術(shù)外文翻譯
- jsp技術(shù)外文翻譯
- jsp技術(shù)概述外文翻譯
- jsp外文翻譯--jsp技術(shù)概述與應(yīng)用框架
- jsp技術(shù)網(wǎng)站設(shè)計(jì)外文翻譯
- 外文翻譯--mysql和jsp的web應(yīng)用程序
- 外文翻譯---jsp動(dòng)態(tài)網(wǎng)站技術(shù)
- jsp外文翻譯
- jsp技術(shù)簡(jiǎn)介及特點(diǎn)外文翻譯
- 外文翻譯----servlet和jsp技術(shù)簡(jiǎn)述
- 外文翻譯---servlet和jsp技術(shù)簡(jiǎn)介
- jsp技術(shù)-畢業(yè)論文外文翻譯
- jsp技術(shù)畢業(yè)論文外文翻譯
- 外文翻譯--- servlet和jsp技術(shù)概要
- 外文翻譯---jsp簡(jiǎn)介
- 外文翻譯--jsp技術(shù)發(fā)展史
- jsp技術(shù)發(fā)展史外文翻譯
評(píng)論
0/150
提交評(píng)論