網頁設計畢設外文翻譯基于JSP網頁自動生成工具的設計與實現_第1頁
網頁設計畢設外文翻譯基于JSP網頁自動生成工具的設計與實現_第2頁
網頁設計畢設外文翻譯基于JSP網頁自動生成工具的設計與實現_第3頁
網頁設計畢設外文翻譯基于JSP網頁自動生成工具的設計與實現_第4頁
網頁設計畢設外文翻譯基于JSP網頁自動生成工具的設計與實現_第5頁
已閱讀5頁,還剩5頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、word附件1:外文資料翻譯譯文基于JSP網頁自動生成工具的設計和實現Web開發技術是Internet使用的一個重要方面,而JSP又是Web開發的最先進的技術,是當前Web開發人員的首選技術。但是由于JSP對Web開發人員要求較高,所以許多一般的Web開發人員還不能夠使用這一項先進的技術。討論基于模板和標簽庫的JSP網頁自動生成工具的設計和實現,提出具體的設計思想和實現方法。 隨著WWWWorld Wide Web的普及,動態網頁技術也急速開展。從原來的CGICommon Gateway Interface到ASPActive Server Page,都從某種程度上滿足了網頁開發人員對動態網頁

2、開發技術的需求。但是不管是CGI還是ASP都存在一定的局限性,如CGI對效勞器資源的消耗,ASP只能同Microsoft IIS一起使用等,這些都限制了這些技術的使用范圍,極大地阻礙了它們的推廣。廣闊的頁面開發人員都熱切地盼望一種統一的頁面開發技術,該技術應該具有的特點:和操作平臺無關,能夠在任何Web或使用程序效勞器上運行;將使用程序邏輯和頁面顯示別離;提供代碼重用,簡化開發基于Web的交互式使用程序的過程。 JSPJava Server Page技術就是被設計用來滿足這樣的要求的。JSP是由Sun MicroSystem公司于1999年6月推出的新的網頁開發技術,它是基于Java Serv

3、let以及整個Java體系的Web開發技術,是Servlet21API的擴展。利用這一技術,可以建立先進、平安和跨平臺的動態網站。 Java是未來的主流開發技術,具有很多優勢。JSP那么是Java在InternetIntranet Web上的重要使用技術,得到了廣泛的支持和成認,它可以和各種Java技術完好地結合在一起,從而實現非常復雜的使用。 作為一種基于文本的、以顯示為中心的開發技術,JSP提供了Java Servlet的所有好處。為了做到邏輯功能和顯示功能分開,JSP已經可以和JavaBeans、Enterprise JavaBeansEJB和Servlet一起工作。JSP的開發人員可以

4、通過使用JavaBeans、EJB和Servlet來完成大局部和網站邏輯相關的工作,而僅僅把顯示的工作交給JSP頁面來完成。內容和顯示邏輯分開的好處在于,更新頁面外觀的人員不必懂得Java代碼,而更新Java類的人員也不必是設計網頁的行家。這就可以用帶Java類的JSP頁面來定義Web模板,以建立一個具有相似外觀的頁面組成的網站。Java類完成數據提供,在模板中就沒有Java代碼,這意味著這些模板可以由一個HTML編寫人員來維護。 JSP作為當前主流的網頁開發技術,具有如下特點:1將內容的生成和顯示進行別離:使用JSP技術,Web頁面開發人員可以使用HTML或者XML標識來設計和格式化最終的頁

5、面。使用JSP標識或者小腳本來生成頁面上的動態內容內容是根據請求來變化的。生成內容的邏輯被封裝在標識和JavaBeans組件中,并且捆綁在小腳本中,所有的腳本在效勞器端運行。如果核心邏輯被封裝在標識和JavaBeans中,那么其他人,如Web管理人員和頁面設計者,能夠編輯和使用JSP頁面,而不影響內容的生成。 2強調可重用的組件:絕大多數JSP頁面依賴于可重用的、跨平臺的組件來完成使用程序所要求的更為復雜的處理。得益于Java的操作平臺無關性,開發人員能夠很方便共享和交流執行普通操作的組件,或者使得這些組件為更多的使用者所使用。基于組件的方法加速了總體的開發過程,極大地提高了工程整體開發的效率

6、。 雖然JSP功能強大,但是它要求網頁開發人員對Java要相當熟悉。而現在Java程序員還比擬少,對一般的網頁開發人員來說,JSP的語法還是比擬難于掌握的。所以,就需要有一種網頁開發工具,為一般的網頁開發人員提供常用的JSP使用,讓只懂得一般頁面開發技術HTML的開發人員也能夠使用JSP的強大功能。 系統設計目標和使用的主要技術: 1設計目標 本系統的設計目標是為只懂得HTML但完全不了解JSP的一般網頁開發人員提供一個網頁開發工具,使他們能夠根據系統文檔,通過標簽使用JSP的常用功能,最后生成一個只包含靜態HTML和JSP標簽的動態JSP網頁。 2主要技術 本系統在設計時,主要考慮使用模板和

7、JSP標簽的技術來實現。 1、模板技術 模板技術被廣泛地使用于各種開發和使用系統中。它預先生成一些常用的框架結構,使用戶可以根據自己的需要方便地從模板庫中選擇模板,而不用自己重新去搭建,節省了用戶的開發時間,方便了用戶的使用。在本系統中,將頁面按照功能類型進行分類,歸納出常用的頁面類型,生成模板庫。 2、標簽庫技術 在JSP中,動作是可以創造和訪問程序語言對象和影響輸出流的元素。JSP定義了六個標準的動作。除了這六個標準動作以外,用戶可以定義自己的動作來完成特定的功能。這些動作被稱為客戶化動作,它們是可重用的程序模塊。通過這些動作,程序員就可以在JSP頁面中把頁面的顯示功能也局部地封裝起來,使

8、整個頁面更加簡潔和易于維護。在一個JSP頁面中,這些客戶化動作是通過客戶化標簽來調用的。而標簽庫Tag Library就是客戶化標簽的集合。 JSP標簽庫是一種通過JavaBeans生成基于XML的腳本的方法。它是JSP的最大特點之一。通過標簽庫,能夠無限制地擴展JSP使用,完成任何復雜的使用需求。 JSP標簽庫具有以下特點:易于使用:JSP中的標簽和一般的HTML標記外表上是完全一樣的,使用起來和普通的HTML標記一樣方便。 易于代碼重用:標簽庫中的每一個標簽都能完成一定的功能。一旦定義好了一個標簽庫,只需要把這個標簽庫包裝成一個Jar文件,那么以后只要在別的系統中使用這個標簽庫就行了,而不

9、用重新開發代碼,極大地提高了系統開發效率,降低了開發本錢。 易于代碼維護:所有的使用邏輯都封裝在標簽處理器和JavaBeans中,所有的標簽都集中在一個標簽庫中。如果需要更新代碼或者需要修改一個網頁上的功能,只需要修改相應的標簽即可。通過這種統一維護方式,不用在每個網頁上去作修改,極大地減少了維護的工作量,節約了維護本錢。 易于系統擴充:如果需要向系統中添加新的功能,只需要定義一個新的標簽來完成這一功能即可,無需對系統的其它方面作任何改動。標簽庫可以繼承JSP標準各方面的特性。這樣就可以無限制地擴展和增加JSP的功能,而不需要等待下一版本JSP的出現。系統的組成和實現: 1系統組成 本系統主要

10、由四個局部組成:1、數據庫連接局部:本系統支持常用的幾個數據庫,包括Oracle、Sybase、MSSQLServer、MySQL和DB2,根據用戶選擇的數據庫類型和用戶提供的數據庫名稱、用戶名、密碼使用JDBC同數據庫相連。 2、系統根本表生成局部:和數據庫連接以后,根據同數據庫相連的用戶名生成兩個系統根本表TCTables和TCColumns,TCTables表包含在該數據庫中屬于該用戶的所有的表的英文名稱、中文名稱和一些屬性,如是否可修改、是否可查詢等;TCColumns表包含在該數據庫中屬于該用戶的所有的表的所有列的中英文名稱和其它一些屬性。如是否可顯示、是否可查詢等。這兩個系統根本表

11、在整個系統的開發過程中提供用戶所使用數據庫的根本信息。 3、模板選擇和網頁生成局部:該局部是系統的核心局部。它包含了兩個子模塊。 模板選擇局部:系統為用戶提供模板選擇界面,讓用戶根據需要從模板庫中選擇所要使用的模板。 模板處理局部:根據用戶選擇的模板,系統調用指定的模板處理模塊對這個模板進行處理。當處理程序遇到模板中的標簽時,就為用戶提供交互界面,讓用戶為指定的標簽輸入參數,并由系統驗證用戶輸入的標簽的有效性。最后由系統完成JSP頁面的生成。 4、網頁預覽和修改局部:網頁生成出來以后,系統為用戶提供了一個網頁預覽窗口和代碼查看修改窗口。通過這個預覽窗口,用戶可以預覽一下生成出來的JSP頁面的效

12、果。如果用戶對頁面的靜態方面的效果不太滿意,用戶可以通過代碼查看修改窗口修改代碼中的HTML代碼。如果用戶對頁面的靜態效果有進一步的要求,系統還為用戶提供了一個調用Dreamweaver編輯器的接口,用戶可以使用它來對生成出來的JSP頁面的靜態效果進行進一步的修改和完善。 2系統的實現 1、模板庫和標簽庫的實現 標簽庫的規劃和設計在整個系統設計中至關重要,它關系到了代碼重用的程度和系統運行的效率。它的規劃應該遵循以下原那么。 1在標簽中應該盡量少的包含靜態的HTML。對于一般用戶來說,標簽是透明的。用戶不能夠查看和修改標簽。如果在標簽中包含了過多的靜態HTML語句,將影響用戶對頁面的靜態效果的

13、修改和完善,限制標簽的使用。 2盡量提高代碼的重用度。在對JSP使用進行分類是盡量把公用的JSP使用提取出來,形成標簽。而不用在每個標簽中都重復實現該使用。這樣在以后要對該使用進行修改和完善時,只需對這一個標簽進行修改即可,易于代碼的維護。 3方便用戶的使用。在設計標簽庫時,應該充分考慮到用戶的使用情況,使用戶能夠很容易和方便地理解和使用標簽。 標簽庫的定義:定義一個標簽庫,必須首先定義一個標簽庫描述文件TLD。這是一個基于XML的腳本文件,在這個文件中定義了XML的版本、所使用的編碼、標簽庫的版本、所使用的JSP的版本、標簽庫的名稱和這個庫中所包含的所有的標簽的定義和參數描述,包括標簽的名稱

14、,標簽所對應的Java類,標簽的描述信息等。 標簽的實現:一個標簽就是一個特殊的Java 類,這個類必須繼承TagSupport類,這個類是在javaxservletjsptagext包中定義的。在標簽類中,包含了這個標簽的參數初始化方法SetGet、標簽的主體處理方法Handler以及供下一級標簽調用的方法等。 模板的實現:一個模板就是一個含有標簽引用的JSP文件。為了在模板中引用所定義的標簽,必須首先引入標簽庫。 tagliburi“tagtldprefix“ctag其中uri指定標簽庫描述文件的路徑;prefix指定引用標簽時所使用的前綴。 在模板中引用指定的標簽時,使用引入標簽庫時所指

15、定的前綴,指定標簽的名稱;為標簽的參數賦值。 2、系統開發環境 本系統主體程序開發使用的是Borland公司的JBuilder 60,模板開發使用是Microsoft公司的FrontPage2000,標簽庫開發使用的是UltraEdit編輯器,JDK采用的是JDK14。系統測試環境是JRun30。 Java是未來開發語言的主流,而Java在Web上的主要使用JSP也必將成為未來Web開發的主流技術。本系統采用了JSP的最大特點之一的標簽庫,使一般的Web開發人員也能夠方便地使用JSP強大的動態頁面功能,開發出技術先進的JSP動態Web頁面。由于本系統采用Java語言進行開發,所以可以在任何支持

16、圖形化界面的操作系統下運行,實現了完全的和平臺無關。本系統易于擴充和完善。在以后可以考慮為用戶提供接口,使用戶可以自己擴充模板庫和標簽庫,進一步增強系統的功能。 附件2:外文原文Produce the design of the tool and realize automatically on the basis of JSP webpageIt is an important respect that Internet uses that Web develops technology, and JSP is the most advanced technology that Web is

17、 developed , it is present Web developer's first-selected technology. But because JSP has relatively high expectations for Web developer, a lot of general Web developers can not use this advanced technology . The discussion produces the design of the tool and realizes automatically on the basis

18、of JSP webpage of the template and label storehouse, put forward concrete design philosophy and implementation method .With the popularization of WWW (World Wide Web ), the technology of the dynamic webpage is developed rapidly too. From original CGI (Common Gateway In-terface ) to ASP (Active Serve

19、r Page ), have met the webpage developer to the demand for developing technology of the dynamic webpage to a certain extent. But no matter CGI or ASP have certain limitation, for instance, consuming to resources of the server of CGI, ASP can only be used etc. with Microsoft IIS, all these have limit

20、ed scope of application of the technology, have hindered their popularization greatly. The vast page developers all look forward to a kind of unified page and develop technology earnestly, characteristic that this technology there should be:Have nothing to do with the operating platform, can run on

21、any Web or the application program server ; Show the logic and page of application program that separates ; Offer codes to put in an position, simplify and develop the course based on interactive application program of Web.JSP (Java Server Page ) technology is designed and used for responding to the

22、 request that like this. JSP is developed technology by the new webpage that Sun MicroSystem Company put out in June of 1999, it is that Web based on Java Serv-let and the whole Java system develops technology, and Servlet2. Expansion of 1API. Utilize this technology, can set up advancedly , safely

23、and stepping dynamic websites of the platform .Java is the future mainstream to develop technology , have a lot of advantages . JSP is Java important application technology on Internet/Intranet Web , get extensive support and admit, it can conbine with various kinds of Java technology together intac

24、tly , thus realize very complicated application.As a kind of technology of development based on text , taking showing as centre, JSP has offered all advantages of Java Servlet. Logic function in order to make sure and showing the function was separated , JSP can already work with JavaBeans , Enterpr

25、ise JavaBeans (EJB ) and Servlet . The developer of JSP can finish the work that majority and website's logic are correlated with through using JavaBeans , EJB and Servlet , and only assign the work shown to JSP page to finish. Content and show advantage that logic separate lie in , upgrade pers

26、on , page of appearance needn't understand Java code , the personnel upgrading Javas needn't be experts who design webpage either. This can define Web template in JSP page with Javas , in order to set up websites made up of a page with similar appearance. Java completion data offer, have Jav

27、a code among template, this mean template these can write by one HTML person is it maintain to come.JSP develops technology as the webpage of the mainstream at present, has the following characteristics:(1) Separate the formulation and showing of the content : Using JSP technology, the page develope

28、r of Web can use HTML or XML identification to design and format the final page . Use JSP identification or bound foot turn into dynamic content of page actually (whether content according to is it come change to ask). Produce logic of content of the identification and JavaBeans package , truss up o

29、f the little script encapsulation, all scripts run in the end of the server. If key logic among identification and JavaBeans, then other people, such as Web administrative staff and page designer encapsulation, can edit and use JSP page , and does not influence the formulation of the content . (2) E

30、mphasize the reusable package : Most JSP pages depend on the reusable one, the package stepping the platform finish more complicated treatment with required application program. Benefitting from the independence of operating platform of Java, the developer can be very convenient to share and exchang

31、e and carry out the ordinary package that operated, or make these packages used by more users. The method based on package has accelerated the total development course, the efficiency of improving the project and developing wholly greatly.Though JSP is powerful, it requires the webpage developer sho

32、uld be quite familiar with Java. There are still relatively few Java programmers now, for general webpage developer, the grammar of JSP is more difficult to grasp . So, need a kind of webpage developing instrument and offer commonly used JSP application to general webpage developer, is it understand

33、 general page develop developer of technology (HTML ) can use strong function of JSP too only to let.Systematic design object and main technology of use:(1)Design objectSystem this design object for understand but HTML understand general webpage developer of JSP offer a webpage developing instrument

34、 at all only, enable them to follow the systematic file, use the daily function of JSP through the label, produce one finally and only include static HTML and dynamic JSP webpage of JSP label.(2)Main technologyThis system is in the design, consider using the technology of the template and JSP label

35、to realize mainly.1、Technology of the templateThe technology of the template is widely applied to various kinds of development and application system. It produces some commonly used frame structure in advance , uses the family to choose the template from the template storehouse conveniently accordin

36、g to the needs of one's own one, is it is it put up to go again by oneself to need , save construction period in user , facilitate use of user. In this system , classify the page according to the function type , sum up the commonly used page type, produce the template storehouse.2、Storehouse tec

37、hnology of the labelIn JSP, movements can create and visit the language target of the procedure and influence the element exported and flowed. JSP has defined six standard movements. Except six standard movement these, user can define own movement finish the specific function. These movements are kn

38、own as the customer movement, they are the reusable procedure module . Through movement these, programmer can some encapsulation stand up too display function of page in JSP page, make the whole page more succinct and easier to maintain. In a JSP page, movements were transfered through the customer

39、label in these customers. And the label storehouse (Tag Library ) is the set of the customer label.JSP label storehouse is that one kind produces the method based on script of XML through JavaBeans. It is one of the greatest characteristics of JSP. Through the label storehouse , can expand JSP appli

40、cation unrestrictedly , finish any complicated application demand.JSP label storehouse has the following characteristic: Easy to use: The labels in JSP and general HTML marks are totally the same in appearance, it is as convenient as ordinary HTML mark to use.The easy code is paid most attention to:

41、 Every label in the label storehouse can finish certain function . Define ready to eat one label storehouse , is it pack one Jar file the label storehouse to need only, then only need use this label storehouse in other systems afterwards, needn't develop codes again , has raised the system and d

42、eveloped efficiency greatly, have reduced the development cost. The easy code is safeguarded: All application logic is encapsulated in label processor and JavaBeans, all labels concentrate on a label storehouse. If need to upgrade codes or need to revise the function on a webpage, only need to revis

43、e the corresponding label. Maintain way in unison through this kind , it is unnecessary in each webpage is it is it fix to act as to get onning, have reduce the work load safeguarded greatly, has economized the cost of safeguarding.The easy system is expanded : If need to add the new function to the

44、 system , only need to define a new label to finish this function, do not need to do any change to other respects of the system. Can inherit JSP normal characteristics of various fields in the label storehouse. Can expand and increase the function of JSP unrestrictedly like this, and does not need t

45、o wait for the appearance of the next edition JSP .Systematic composition and realizing:(1)The system making upThis system is made up of four parts mainly:1、The database joins some: This system supports several daily databases , including Oracle, Sybase, MSSQLServer, MySQL and DB2, use JDBC and data

46、base to link to each other according to database type and database name , user name , password that users offer that users choose.2、The basic form of system produces some: After joining with the database , produce the basic form TC-Tables and TC-Columns of two systems according to the user name link

47、ing to each other with the database , TC-Tables form includes English name , Chinese name and some attribute of form belonging to this user in this database , for instance can revise , can inquire about ; The Chinese and English name of the row and some other attribute that TC-Columns form includes

48、belonging to all forms of this user's in this database . For instance can show , can inquire about . Basic information of the database that these basic forms of two systems provide to user's institute for use in the course of development of the whole system. 3、The template is chosen to produ

49、ce some with the webpage: This part is a key part of a system. It includes two pieces of sub module . The template is chosen some: The system offers the template to user and chooses the interface, let users choose the templates used from the template storehouse according to the need. The template is

50、 dealt with some: According to template that user choose, system transfer designated template deal with module is it punish to go on to these template. When dealing with the label that the procedure meets in the template, offer the mutual interface to user, let user input parameter for designated la

51、bel , prove system validity of label that user input. Finished the formulation of JSP page systematically finally.Webpage preview is with revising some: After the webpage was produced out, the system has offered a webpage preview window and code to user and looked over that revises the window. Throu

52、gh this preview window, users can look at the result of JSP page produced out in advance . If user static result of respect in page very satisfied, user can through code look over revise window revise HTML code of code. If users have further demands for the static result of the page, the system has

53、also offered a piece of interface which transfers DreamWeaver editing machine to user, users can use it to carry on further modification and perfection to the static result of JSP page that is produced out .(2)Systematic realization1、Realization of the template storehouse and label storehouseThe pla

54、nning and design of the label storehouse are essential in the whole system design, efficiency that the degree and system that are put in an position have operated that its relation has reached codes. Its planning should follow the following principle .(1) Should try one's best little including s

55、tatic HTML among label. To general user, the label is transparent. Users can not look over and revise labels . If include too many static HT-ML sentence in the label , will influence the modification and perfection of user's static result to the page, limit the use of the label.(2) Try one's

56、 best to raise the paying most attention to degree of the code. Is it is it is it is it is it is it get to JSP public JSP out to withdraw to use to try one's best to classify to go on to use, form labels. Do not use and realize this application repeatedly in each label . While revising and perfe

57、cting to using like this , only need to revise this label, maintenance of the easy code.(3) Facilitate users' use. While designing the label storehouse , should fully consider users' operating position , it can very easy and understanding and using labels conveniently to use the family. Defi

58、nition of the label storehouse: Define a label storehouse, must define a label storehouse and describe the file (TLD ) at first . This is a file of script based on XML, have defined the edition of XML in this file , codes used, the edition , name and definition and parameter of all labels included i

59、n this storehouse of the label storehouse of the edition of the label storehouse , JSP used describe, including the name of the label, corresponding Javas of label, description information of the label ,etc. Realization of the label: One label first special Java type, this each must inherit TagSupports , t

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論