2023年全國(guó)碩士研究生考試考研英語(yǔ)一試題真題(含答案詳解+作文范文)_第1頁(yè)
已閱讀1頁(yè),還剩33頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、<p>  JSP Technology(外文原文)</p><p>  JSP (JavaServer Pages) is a kind of based on Java script technology. In many of the advantages of JSP, one of which is it can the HTML code from Web pages in the busi

2、ness logic of the effectively separated. With JSP visit reusable components, such as Servlet, JavaBean and based on Java Web applications. JSP also support in Web page direct embedded Java code. The two methods can visit

3、 JSP files: browser to send files request, sent to the JSP Servlet request.</p><p>  JavaServer Pages technology is an extension of the Java Servlet technology. Servlets are platform-independent, server-side

4、 modules that fit seamlessly into a Web server framework and can be used to extend the capabilities of a Web server with minimal overhead, maintenance, and support. Unlike other scripting languages, servlets involve no p

5、latform-specific consideration or modifications; they are application components that are downloaded, on demand, to the part of the system that needs them. To</p><p>  The Unified Expression Language (EL) &l

6、t;/p><p>  The simple EL included in JSP 2.0 technology offers many advantages to the page author. Using simple expressions, page authors can easily access external data objects from their pages. The JSP techno

7、logy container evaluates and resolves these expressions as it encounters them. It then immediately returns a response because the JSP request-processing model has only one phase, the render phase. However, because the re

8、quest-processing model does not support a postback, all JSP expressions are read-</p><p>  Unlike JSP technology, JavaServer Faces technology supports a multiphase life cycle. When a user enters values into

9、the JavaServer Faces UI components and submits the page, those values are converted, validated, and propagated to server-side data objects, after which component events are processed. In order to perform all these tasks

10、in an orderly fashion, the JavaServer Faces life cycle is split into separate phases. Therefore, JavaServer Faces technology evaluates expressions at different phas</p><p>  JSP technology -- friend or foe?&

11、lt;/p><p>  Presentation technology was designed to transform plain ol' raw Web content into content wrapped in an attractive presentation layer. JavaServer Pages (JSP) technology, Sun's presentation mo

12、del and part of the J2EE platform, has received significant attention. There are both advantages and disadvantages to using JSP technology, and Web developers should be aware of the good and the bad -- and know that they

13、 don't have to be limited to this single technology. In fact, these days a number of prese</p><p>  The premiseToday, a decade beyond those fledgling Windows applications, we are still dealing with this

14、huge shift in the presentation paradigm. The woeful Visual Basic and C programmers who remain now find themselves working either on back-end systems or Windows-only applications, or they have added a Web-capable language

15、 such as the Java language to their toolbox. An application that doesn't support at least three of four ML-isms -- such as HTML, XML, and WML -- is considered shabby, if not an </p><p>  Segregation vs.

16、integration</p><p>  The primary purpose of presentation technology is to allow a separation between content and presentation. In other words, business logic units (presumably in some programming language li

17、ke C or Java) don't have to generate data in a presentation-specific manner. Data, or content, is returned raw, without formatting. The presentation technology then applies formatting, or presentation, to this conten

18、t. The result is an amalgam of data surrounded by and intertwined with graphics, formatting, color</p><p>  class=displaycodeRussell Crowe </p><p>  Tom Hanks </p><p><b>  Meg

19、 Ryan </b></p><p>  Mary Stuart Masterson </p><p>  Alec Baldwin </p><p>  Ashley Judd </p><p>  Keanu Reeves</p><p>  Listing 2, which is much more

20、complex than the one above, shows the same data wrapped in presentation technology and ready for display in an HTML-capable browser. </p><p>  class=displaycode<HTML> </p><p><b>  &l

21、t;HEAD> </b></p><p>  <TITLE>Search Results: Actors</TITLE> </p><p><b>  </HEAD> </b></p><p><b>  <BODY> </b></p><

22、;p>  <H2 ALIGN="center">Search Results: Actors</H2> </p><p><b>  <CENTER> </b></p><p>  <HR width="85%"> </p><p>  <

23、TABLE width="50%" CELLPADDING="3" CELLSPACING="3" border="1" </p><p>  BGCOLOR="#FFFFCC"> </p><p>  <TR BGCOLOR="#FFCCCC"> &l

24、t;/p><p>  <TH width="50%" ALIGN="center">Last Name</TH> </p><p>  <TH width="50%" ALIGN="center">First Name</TH> </p><p&g

25、t;<b>  </TR> </b></p><p><b>  <TR> </b></p><p>  <TD width="50%">Baldwin</TD> </p><p>  <TD width="50%">Ale

26、c</TD> </p><p><b>  </TR> </b></p><p><b>  <TR> </b></p><p>  <TD width="50%">Crowe</TD> </p><p>  <T

27、D width="50%">Russell</TD> </p><p><b>  </TR> </b></p><p><b>  <TR> </b></p><p>  <TD width="50%">Hanks</TD

28、> </p><p>  <TD width="50%">Tom</TD> </p><p><b>  </TR> </b></p><p><b>  <TR> </b></p><p>  <TD width=&q

29、uot;50%">Judd</TD> </p><p>  <TD width="50%">Ashley</TD> </p><p><b>  </TR> </b></p><p><b>  <TR> </b></p&

30、gt;<p>  <TD width="50%">Masterson</TD> </p><p>  <TD width="50%">Mary Stuart</TD> </p><p><b>  </TR> </b></p><p&g

31、t;<b>  <TR> </b></p><p>  <TD width="50%">Reeves</TD> </p><p>  <TD width="50%">Keanu</TD> </p><p><b>  </TR&g

32、t; </b></p><p><b>  <TR> </b></p><p>  <TD width="50%">Ryan</TD> </p><p>  <TD width="50%">Meg</TD> </p>&

33、lt;p><b>  </TR> </b></p><p><b>  </TABLE> </b></p><p><b>  </CENTER></b></p><p>  While the content in Listing 1 is clear an

34、d easy for the uninitiated layperson to both use and understand, the content in Listing 2 is very specific to the task of display in a browser. It is tricky to extract data from it or manipulate it for any other purpose.

35、This fundamental difference, the process of segregating content from presentation instead of integrating the two (at least until the user needs the information), is the basic premise of any presentation technology, inclu

36、ding the JSP techn</p><p>  Work vs. rework</p><p>  Besides the separation of content and presentation, another measure of a presentation technology's usefulness is the amount of rework tha

37、t it eliminates. The divergence of presentation and content enforces a divergence in the roles of those developing the content. A programmer can focus on the raw content presented in the examples above, and a graphic art

38、ist or webmaster can attend to the presentation. A slight overlap of roles remains, however, in the process of taking the presentation -- or ma</p><p>  The promise of JSP technology</p><p>  No

39、w, on to the specifics of JSP coding. The promise of JSP technology is to supply the designer and developer the only presentation technology they will ever need. JSP technology is part of the J2EE platform, which is the

40、strongest show of support Sun can give one of its Java products. To give you an idea of how prevalent this solution is, try running a search on 'JSP' at amazon.com; you'll find more books devoted to JSP techn

41、ology than about almost any other single Java API. Before I dive into </p><p>  Content vs. presentation</p><p>  Above all, JSP technology is about separating content from presentation, foremo

42、st in Sun's published set of goals for JSP pages. In fact, JSP design stemmed directly from the complaints of developers who were tired of typing out.println("<HTML><HEAD><TITLE>" + pageIn

43、fo.getTitle() + "</TITLE></HEAD>"); into their servlet code. This mixing of hard-coded content with runtime variables presented a horrible burden on servlet developers. It also made making even mino

44、r changes to the presentation layer</p><p>  class=displaycode<%@ page import="com.ibm.display.PageUtils" %> </p><p>  <%@ page import="com.ibm.display.PageInfo" %&g

45、t; </p><p><b>  <% </b></p><p>  PageInfo pageInfo = (PageInfo)session.getAttribute("PAGE_DATA") </p><p><b>  %> </b></p><p><

46、;b>  <HTML> </b></p><p><b>  <HEAD> </b></p><p><b>  <TITLE> </b></p><p>  <%=pageInfo.getTitle()%> </p><p><

47、;b>  </TITLE> </b></p><p><b>  </HEAD> </b></p><p><b>  <BODY> </b></p><p>  <!-- Other HTML content --> </p><p&g

48、t;<b>  </BODY> </b></p><p><b>  </HTML></b></p><p>  Judging by these initial principles, then, JSP technology (at least in its stated design) would satisfy t

49、he first tenet of a presentation technology, as outlined above: that content be separated from presentation.</p><p>  Code vs. markup</p><p>  Second on the JSP technology's list of features

50、 is something that might raise a bit of concern. JSP coding lets you insert Java code directly into a page of markup. To understand why this decision was made, recall that when the JSP specification was being developed,

51、Sun's competition from Microsoft was at an all-time high, primarily due to the success of Microsoft Active Server Pages (ASP). The similarity of the name JavaServer Pages to Active Server Pages was not merely coincid

52、ental. And the ab</p><p>  class=displaycode<%@ page import="com.ibm.display.PageUtils" %> </p><p>  <%@ page import="com.ibm.display.PageInfo" %> </p><

53、;p>  <%@ page import="com.ibm.people.Actor" %> </p><p>  <%@ page import="java.util.Iterator" %> </p><p>  <%@ page import="java.util.Vector" %>

54、; </p><p><b>  <% </b></p><p>  PageInfo pageInfo = (PageInfo)session.getAttribute("PAGE_DATA") </p><p>  Vector actors = pageInfo.getActors() </p>&

55、lt;p><b>  %> </b></p><p><b>  <HTML> </b></p><p><b>  <HEAD> </b></p><p><b>  <TITLE> </b></p><p&g

56、t;  <%=pageInfo.getTitle()%> </p><p><b>  </TITLE> </b></p><p><b>  </HEAD> </b></p><p><b>  <BODY> </b></p><p

57、>  <H2 ALIGN="center">Search Results: Actors</H2> </p><p><b>  <CENTER> </b></p><p>  <HR width="85%"> </p><p>  <TA

58、BLE width="50%" CELLPADDING="3" CELLSPACING="3" border="1" </p><p>  BGCOLOR="#FFFFCC"> </p><p><b>  <% </b></p><p&

59、gt;  for (Iterator i = actors.iterator(); i.hasNext()) { </p><p>  Actor actor = (Actor)i.next(); </p><p><b>  %> </b></p><p>  <TR BGCOLOR="#FFCCCC">

60、 </p><p>  <TH width="50%" ALIGN="center"> </p><p>  <%=actor.getLastName()%> </p><p><b>  </TH> </b></p><p>  <TH

61、width="50%" ALIGN="center"> </p><p>  <%=actor.getFirstName()%> </p><p><b>  </TH> </b></p><p><b>  </TR> </b></p

62、><p><b>  <% </b></p><p><b>  } </b></p><p><b>  %> </b></p><p><b>  </TABLE> </b></p><p>  </C

63、ENTER> </p><p><b>  </BODY> </b></p><p><b>  </HTML></b></p><p>  Remember that so far I am simply describing the initial design goals of JSP

64、technology; I'll defer my own judgment about the goals until a later section about the problems of JSP technology. You might be a little suspicious already, however, since embedding code into a JSP page would seem to

65、 cause problems with the first goal of JSP technology, separating content from presentation. But really (ahem), I'm not editorializing yet.</p><p>  Designer vs. developer</p><p>  A final (

66、and admirable) goal of JSP technology worth mentioning is that it seeks to establish clearly defined roles in the application development process. By ostensibly breaking content from presentation, JSP technology creates

67、a clearer distinction between the designer and developer. The designer creates markup, using only standard HTML, WML, or whatever language is appropriate, and the developer writes code. Of course, many designers today ha

68、ve learned JavaScript, so it should come as no surp</p><p>  The problemsI've spelled out what a good presentation technology should provide, as well as the specific problems that JSP technology seeks to

69、 address. Now, I'm ready to cut to the chase: JSP technology, while built on good ideas, presents quite a few problems. Before you choose to use JSP coding in your applications (which you might still do), you should

70、at least be aware of possible pitfalls.You should also be aware of a facet of the J2EE programming platform that is often ignored: just becaus</p><p>  class=displaycode<%@ page import="com.ibm.displ

71、ay.PageUtils" %> </p><p>  <%@ page import="com.ibm.display.PageInfo" %> </p><p>  <%@ page import="com.ibm.logic.AdminUtils" %> </p><p>  &l

72、t;%@ page import="com.ibm.people.Actor" %> </p><p>  <%@ page import="java.util.Iterator" %> </p><p>  <%@ page import="java.util.Vector" %> </p&g

73、t;<p><b>  <% </b></p><p>  PageInfo pageInfo = (PageInfo)session.getAttribute("PAGE_DATA") </p><p><b>  %> </b></p><p><b>  <

74、;HTML> </b></p><p><b>  <HEAD> </b></p><p><b>  <TITLE> </b></p><p>  <%=pageInfo.getTitle()%> </p><p><b>  <

75、;/TITLE> </b></p><p><b>  </HEAD> </b></p><p><b>  <BODY> </b></p><p>  <H2 ALIGN="center">Search Results: Actors</H2

76、> </p><p><b>  <CENTER> </b></p><p>  <HR width="85%"> </p><p>  <TABLE width="50%" CELLPADDING="3" CELLSPACING="

77、3" border="1" </p><p>  BGCOLOR="#FFFFCC"> </p><p><b>  <% </b></p><p>  // Based on user's permissions, perform search differently (b

78、usiness logic!) </p><p>  Vector actors = pageInfo.getActors() </p><p>  if (pageInfo.getUserInfo().hasPermission("ADMINISTRATOR")) { </p><p>  actors = AdminUtils.getActo

79、rs(pageInfo.getSearchCriteria()); </p><p><b>  } else { </b></p><p>  actors = pageInfo.getActors(); </p><p><b>  } </b></p><p>  for (Iterator

80、i = actors.iterator(); i.hasNext()) { </p><p>  Actor actor = (Actor)i.next(); </p><p><b>  %> </b></p><p>  <TR BGCOLOR="#FFCCCC"> </p><p&

81、gt;  <TH width="50%" ALIGN="center"> </p><p>  <%=actor.getLastName()%> </p><p><b>  </TH> </b></p><p>  <TH width="50%&quo

82、t; ALIGN="center"> </p><p>  <%=actor.getFirstName()%> </p><p><b>  </TH> </b></p><p><b>  </TR> </b></p><p><

83、b>  <% </b></p><p><b>  } </b></p><p><b>  %> </b></p><p><b>  </TABLE> </b></p><p>  </CENTER> </p>

84、;<p><b>  </BODY> </b></p><p><b>  </HTML></b></p><p>  JSP advocates are quick to let you know that JSP tag libraries can help you avoid this problem.

85、 Tag libraries allow custom tags (for example, <AUTHORS />) to be added to a JSP page, which at runtime are resolved into code fragments in, well, tag libraries.The use of a custom tag and associated tag library wo

86、uld allow the example above to be converted to that shown in Listing 6. </p><p>  class=displaycode<CENTER> </p><p>  <TABLE width="50%" CELLPADDING="3" CELLSPACING=

87、"3" border="1" </p><p>  BGCOLOR="#FFFFCC"> </p><p>  <ACTORS /> </p><p><b>  </TABLE> </b></p><p><b>  &

88、lt;/CENTER></b></p><p>  At runtime, the code for this tag executes and the correct results are inserted into the page. But this does not solve the problem. The argument against JSP technology is no

89、t whether content and presentation can be separated, but whether they must be separated. As long as JSP coding allows inline coding, it is very convenient (especially when deadlines are looming) to make last-minute chang

90、es with inline code, rather than converting the code to a tag library. If this doesn't ring true, consider </p><p>  Single-processing vs. multi-tasking</p><p>  Ideally, as discussed above,

91、 a designer ought to be able to perform a single process, working purely on graphic design, and a developer should be able to focus purely on coding. So the designer should be able to work on a page after it has been con

92、verted to an application-suitable format. In the case of a JSP page, that would be after JavaBeans have been imported, inline coding has been inserted, and custom tag libraries have been added to the page. The problem is

93、 that some designers use HTML ed</p><p>  JSP 技術(shù)(中文翻譯)</p><p>  JSP(JavaServer Pages)是一種基于Java的腳本技術(shù)。在JSP 的眾多優(yōu)點(diǎn)之中,其中之一是它能將 HTML 編碼從 Web 頁(yè)面的業(yè)務(wù)邏輯中有效地分離出來。用 JSP 訪問可重用的組件,如 Servlet、JavaBean 和基于 Java

94、的 Web 應(yīng)用程序。JSP 還支持在 Web 頁(yè)面中直接嵌入 Java 代碼。可用兩種方法訪問 JSP 文件:瀏覽器發(fā)送 JSP 文件請(qǐng)求、發(fā)送至 Servlet 的請(qǐng)求。</p><p>  JavaServer頁(yè)技術(shù)在教育領(lǐng)域的延伸,爪哇Servlet技術(shù)。服務(wù)器端模塊 Servlets也是獨(dú)立于平臺(tái)的,那無縫進(jìn)網(wǎng)頁(yè)服務(wù)器框架,可以用于擴(kuò)展功能的一個(gè)網(wǎng)絡(luò)服務(wù)器用最小的代價(jià)、維護(hù)和支持。不像其他的腳本語(yǔ)言,s

95、ervlets涉及沒有平臺(tái)相關(guān)的考慮或者修改;他們的應(yīng)用程序組件,下載,對(duì)需求,對(duì)系統(tǒng)的一部分,需要他們。在一起,JSP技術(shù)和servlets提供一個(gè)更有吸引力的選擇到其他類型的動(dòng)態(tài)網(wǎng)頁(yè)腳本/規(guī)劃在祭:平臺(tái)獨(dú)立性;增強(qiáng)的表現(xiàn);分離的邏輯從顯示;易于管理、延伸性進(jìn)企業(yè);而且,最重要的是,簡(jiǎn)單易用。</p><p>  統(tǒng)一的表現(xiàn)語(yǔ)言(EL)</p><p>  簡(jiǎn)單的EL包括在JSP 2.

96、0技術(shù)也提供了許多優(yōu)勢(shì)網(wǎng)頁(yè)作者。作者用簡(jiǎn)單的表情,一頁(yè)就可以很容易地找到外部數(shù)據(jù)對(duì)象從他們的網(wǎng)頁(yè)。JSP技術(shù)評(píng)估和解決這些表達(dá)式容器作為它碰到他們。然后,它立即返回一個(gè)響應(yīng)因?yàn)镴SP request-processing模型只有一個(gè)階段,呈現(xiàn)階段。然而,由于request-processing模型不支持一個(gè)回發(fā),所有的JSP表達(dá)式是只讀的。</p><p>  不像JSP技術(shù),JavaServer面臨的技術(shù)支持多

97、相生命周期。當(dāng)用戶輸入值到JavaServer UI組件的臉并提交頁(yè)面,這些價(jià)值的轉(zhuǎn)換,確認(rèn),并傳播到服務(wù)器端數(shù)據(jù)對(duì)象,之后組件事件正在處理中。為了完成所有這些任務(wù)中有序的時(shí)尚,JavaServer面臨生命周期是可以分成不同的階段。因此,JavaServer面臨工藝評(píng)定表達(dá)生命周期的不同階段,而不是立即,JSP技術(shù)都會(huì)做的事。</p><p>  此外,表達(dá)式可能會(huì)被用于設(shè)置以及獲得數(shù)據(jù),這樣的價(jià)值觀也進(jìn)入了一個(gè)

98、用戶界面組件傳播給服務(wù)器端的對(duì)象在回發(fā)。最后,一些JavaServer面臨技術(shù)可被調(diào)用方法表達(dá)在服務(wù)器端的對(duì)象的生命周期的不同階段為了驗(yàn)證數(shù)據(jù)和處理組件事件。</p><p>  JSP 技術(shù) -- 是友還是敵?</p><p>  表示技術(shù)設(shè)計(jì)用來將平淡的拉丁文原始 Web內(nèi)容轉(zhuǎn)化為包裝在有吸引力的表示層中的內(nèi)容。JavaServer Pages (JSP)技術(shù),作為 Sun 公司的表示

99、模型和 J2EE平臺(tái)的一部分,受到了極大關(guān)注。使用 JSP 技術(shù)有利有弊,Web開發(fā)人員應(yīng)知曉這些利弊 --懂得他們不必拘泥于這一技術(shù)。實(shí)際上,近來出現(xiàn)了許多表示技術(shù)。本文以表示技術(shù)所要解決的問題為開端,然后考察JSP 模型的特有優(yōu)勢(shì)和弱點(diǎn)。最后,介紹幾個(gè)可以代替 Sun的表示技術(shù)的可行方案。歷史點(diǎn)滴</p><p>  在深入解釋表示技術(shù)之前,介紹一些導(dǎo)致此技術(shù)產(chǎn)生的詳細(xì)背景資料很有幫助。僅僅在10年前, 瘦客

100、戶機(jī)還是一個(gè)很新的術(shù)語(yǔ)。那時(shí)我們還生活在臺(tái)式機(jī)應(yīng)用程序的世界中,使用低級(jí)的286 微處理器,瞇著眼看 14英寸的顯示器。但是現(xiàn)在時(shí)代不同了,讀者們!現(xiàn)在,我的臺(tái)式機(jī)除了運(yùn)行Web 瀏覽器之外什么也不干。我們使用 Sun、IBM、HP、Compaq和其他公司的服務(wù)器來運(yùn)行計(jì)算、業(yè)務(wù)邏輯和內(nèi)容。那個(gè)小顯示器呢?它已被又大又漂亮的21 英寸和 25英寸等離子體平面顯示器所取代。為什么呢?因?yàn)檫@樣我們就可以觀看錯(cuò)綜復(fù)雜的HTML 顯示,而這些

101、HTML顯示是強(qiáng)大的應(yīng)用程序的前端。單調(diào)沉悶的界面已不能滿足要求;現(xiàn)在,我們希望看到華麗的圖形、移動(dòng)的圖像、色彩協(xié)調(diào)的表示,不管哪個(gè)房間看上去都那么漂亮,并且能夠快速顯示出來。 </p><p><b>  前提</b></p><p>  十年后的今天,作為雛形的 Windows應(yīng)用程序已經(jīng)成為歷史,我們?nèi)悦媾R著表示方法上的巨大轉(zhuǎn)變。悲慘的Visual Basic

102、和 C 程序員發(fā)現(xiàn),他們現(xiàn)在只能編寫后端系統(tǒng)或僅用于Windows 的應(yīng)用程序,或者已在自己的工具箱中添加了能提供 Web功能的語(yǔ)言,例如 Java 語(yǔ)言。不支持四分之三以上 ML 語(yǔ)言(如HTML、XML 和WML)的應(yīng)用程序即使不被認(rèn)為是完全失敗的,也會(huì)被認(rèn)為是很低劣的。當(dāng)然,這說明我們都很注重很容易地開發(fā)Web 表示層的能力。 結(jié)果是,使用新的因特網(wǎng),以及我們熟悉的所有語(yǔ)言(Java、C、Perl、Pascal、Ada以及其他語(yǔ)言

103、)都不像我們所希望的那么容易。當(dāng)將每個(gè)人都使用的編程語(yǔ)言用于后端程序并生成適用于客戶機(jī)的標(biāo)記語(yǔ)言時(shí),會(huì)出現(xiàn)一大量的問題。隨著瀏覽器提供更多的選項(xiàng)(例如DHTML 和 JavaScript 編碼)、Web領(lǐng)域圖形藝術(shù)人才的增加、以及能夠使用標(biāo)準(zhǔn) HTML生成復(fù)雜界面的工具的出現(xiàn),對(duì)別具一格的用戶界面的需求比我們開發(fā)這些應(yīng)用程序前端的能力增長(zhǎng)得還要快。這就導(dǎo)致了 表示技術(shù)的興起。 表示技術(shù)設(shè)計(jì)用來執(zhí)行一項(xiàng)任務(wù):將內(nèi)容(即不帶顯示詳細(xì)<

104、/p><p><b>  隔離與集成</b></p><p>  表示技術(shù)的最基本目的是使得內(nèi)容和表示可以分離開來。換言之,業(yè)務(wù)邏輯單元(可能用C 或 Java語(yǔ)言編寫)不必以表示特定的方式生成代碼。數(shù)據(jù)或者內(nèi)容以原始形式返回,不帶任何格式。之后,表示技術(shù)為這些內(nèi)容添加格式或表示。結(jié)果是,數(shù)據(jù)被圖形、格式、顏色和徽標(biāo)環(huán)繞包圍起來。 請(qǐng)看清單 1 和清單 2中的示例,看一下

105、原始內(nèi)容和結(jié)合了表示技術(shù)的內(nèi)容之間的區(qū)別。清單 1顯示的是原始內(nèi)容,除了數(shù)據(jù)外別無他物,可以通過多種方式使用。清單 1. 只包含數(shù)據(jù)的原始內(nèi)容 </p><p>  class=displaycodeRussell Crowe </p><p>  Tom Hanks </p><p><b>  Meg Ryan </b></p>

106、<p>  Mary Stuart Masterson </p><p>  Alec Baldwin </p><p>  Ashley Judd </p><p>  Keanu Reeves</p><p>  清單 2就比上一個(gè)清單復(fù)雜多了,它顯示的是相同的數(shù)據(jù),但這些數(shù)據(jù)包裝在表示技術(shù)中,并且隨時(shí)可以在支持HTML 的

107、瀏覽器中顯示。清單 2.用表示包裝的數(shù)據(jù) </p><p>  class=displaycode<HTML> </p><p><b>  <HEAD> </b></p><p>  <TITLE>搜索結(jié)果:演員</TITLE> </p><p><b>  &

108、lt;/HEAD> </b></p><p><b>  <BODY> </b></p><p>  <H2 ALIGN="center">搜索結(jié)果:演員</H2> </p><p><b>  <CENTER> </b></p&g

109、t;<p>  <HR WIDTH="85%"> </p><p>  <TABLE WIDTH="50%" CELLPADDING="3" CELLSPACING="3" BORDER="1" </p><p>  BGCOLOR="#FFFFCC

110、"> </p><p>  <TR BGCOLOR="#FFCCCC"> </p><p>  <TH WIDTH="50%" ALIGN="center">姓</TH> </p><p>  <TH WIDTH="50%" AL

111、IGN="center">名</TH> </p><p><b>  </TR> </b></p><p><b>  <TR> </b></p><p>  <TD WIDTH="50%">Baldwin</TD>

112、</p><p>  <TD WIDTH="50%">Alec</TD> </p><p><b>  </TR> </b></p><p><b>  <TR> </b></p><p>  <TD WIDTH="

113、50%">Crowe</TD> </p><p>  <TD WIDTH="50%">Russell</TD> </p><p><b>  </TR> </b></p><p><b>  <TR> </b></p>

114、;<p>  <TD WIDTH="50%">Hanks</TD></p><p>  <TD WIDTH="50%">Tom</TD> </p><p><b>  </TR> </b></p><p><b>  &l

115、t;TR> </b></p><p>  <TD WIDTH="50%">Judd</TD> </p><p>  <TD WIDTH="50%">Ashley</TD> </p><p><b>  </TR> </b><

116、;/p><p><b>  <TR> </b></p><p>  <TD WIDTH="50%">Masterson</TD> </p><p>  <TD WIDTH="50%">Mary Stuart</TD> </p><

117、p><b>  </TR> </b></p><p><b>  <TR> </b></p><p>  <TD WIDTH="50%">Reeves</TD> </p><p>  <TD WIDTH="50%">K

118、eanu</TD> </p><p><b>  </TR> </b></p><p><b>  <TR> </b></p><p>  <TD WIDTH="50%">Ryan</TD> </p><p>  <

119、;TD WIDTH="50%">Meg</TD> </p><p><b>  </TR> </b></p><p><b>  </TABLE> </b></p><p>  </CENTER> </p><p><b

120、>  </BODY> </b></p><p><b>  </HTML> </b></p><p>  清單 1中的內(nèi)容對(duì)毫無經(jīng)驗(yàn)的外行人來說,易于理解,也便于使用。清單 2中的內(nèi)容則專用于在瀏覽器中顯示。從清單 2中提取數(shù)據(jù),或處理它用于其他目的,就需要有一些技巧。這一基本區(qū)別 --將表示和內(nèi)容分開而不是集成在一起的處理(

121、至少在用戶不需要這些信息時(shí)是這樣),是表示技術(shù)(包括 JSP技術(shù))的前提。進(jìn)一步說,沒有達(dá)到這一基本目標(biāo)的表示技術(shù)就沒有真正實(shí)現(xiàn)設(shè)計(jì)的最初目的。</p><p><b>  編寫與修改</b></p><p>  除了將內(nèi)容和表示分離開來以外,衡量表示技術(shù)是否有用的另外一個(gè)因素則是它所免除的修改工作量。表示和內(nèi)容的分離加大了內(nèi)容開發(fā)人員的角色差別。程序員可將注意力集中

122、在前面示例中的原始內(nèi)容上,圖形藝術(shù)家或網(wǎng)站管理員則可將精力放在表示上。但是,在把藝術(shù)家設(shè)計(jì)的表示或標(biāo)記取出并加入到程序員編制的內(nèi)容中時(shí),還會(huì)出現(xiàn)一些角色交迭。 在最簡(jiǎn)單的情況下,藝術(shù)家提供標(biāo)記,開發(fā)人員提供代碼并將標(biāo)記插入表示技術(shù)中。然后,應(yīng)用程序“啟動(dòng)”,內(nèi)容會(huì)魔術(shù)般地變成一個(gè)用戶界面。當(dāng)然,我們都知道,開發(fā)工作通常不會(huì)僅止于此。下一步是修訂和更改界面,并編制新的業(yè)務(wù)規(guī)則,這正是檢驗(yàn)表示技術(shù)靈活性的地方。雖然更新輸入到表示層中的原始數(shù)

123、據(jù)通常并不難,但是圖形藝術(shù)家就很難對(duì)他們的原始作品進(jìn)行編輯。對(duì)表示層的更改是很常見的(我們都飽受過市場(chǎng)部門改這改那之苦)。所以,現(xiàn)在出現(xiàn)了這樣一個(gè)問題:設(shè)計(jì)人員應(yīng)該從何處入手來更改他們的工作?是修改他們交給開發(fā)人員的原始標(biāo)記語(yǔ)言頁(yè)嗎?可能不是。因?yàn)樽羁赡艿氖?,此?yè)很可能已插入定制標(biāo)記或代碼(JSP頁(yè)、模板引擎)、轉(zhuǎn)化為 Java servlet、或者已變得面目全非了。通常,設(shè)計(jì)人員必須在原始頁(yè)上進(jìn)行修</p><p&

124、gt;<b>  JSP 技術(shù)的承諾</b></p><p>  現(xiàn)在,我們來討論 JSP 編碼的具體內(nèi)容。JSP技術(shù)承諾為設(shè)計(jì)人員和開發(fā)人員提供他們所需的最合適的表示技術(shù)。JSP技術(shù)是 J2EE 平臺(tái)的一部分,顯示了 Sun 公司所能給予 Java產(chǎn)品的最強(qiáng)大支持。為了使您對(duì)此解決方案的流行程度有一個(gè)概念,您可以試著在amazon.com 上搜索一下“JSP”,您會(huì)發(fā)現(xiàn),論述 JSP的書籍

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝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ù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 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ì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論