版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、<p><b> 外文文獻資料</b></p><p> 收集: 應用技術學院 06計算機科學與技術(0616403057) 傅曉燕</p><p> ?。ㄍ馕奈募?JSP Splitting for Improving Execution Performance)</p><p><b> Abstract<
2、;/b></p><p> Splitting a JSP (Java Server Pages) page into fragments can improve the execution performance of JSP pages when the Web application server can separately cache the Web page fragments obtaine
3、d by executing the JSP fragments. If a JSP page is split into fragments according to the update frequency of each portion of the Web page obtained by executing the JSP page, all of the split JSP fragments do not need to
4、be executed again when only a single cached part of a Web page expires. In addition, the f</p><p> 1. Introduction</p><p> Splitting a JSP (Java Server Pages) page into fragments can improve t
5、he execution performance of some JSP pages when the Web application server can separately cache the Web page fragments obtained by executing the fragments of the JSP page. The period of caching dynamic Web pages generate
6、d by a JSP engine is limited due to the dynamic nature of the content. When the cached content of a Web page generated by a JSP engine is updated, the entire JSP page must be executed again on the application se</p>
7、;<p> The application offload technology of IBM WebSphere Edge Server is another approach to improve the execution performance of JSP pages. This technology allows one or more JSP fragments to be cached and execu
8、ted on edge servers. The remaining JSP fragments are deployed on the application server and are called by the JSP fragments executed on the edge server. Thus, some of the execution of a JSP page is offloaded to the edge
9、server. </p><p> Splitting a JSP page facilitates the reuse of JSP fragments. When a Web application consists of many JSP pages, the same portions tend to exist in many JSP pages. Examples are the frames, t
10、he banners, the headers, and etc. </p><p> When a JSP page is split into fragments, the total execution result of all of the fragments must be the same as the JSP page before it was split. In addition, when
11、 the fragments of a JSP page are executed in different servers, each fragment needs to be executed without the other fragments. In order to satisfy these conditions, we propose JSP splitting, which is the method of split
12、ting a JSP page into fragments described in this paper. Since it is very difficult to automatically find the best way</p><p> The rest of the paper is organized as follows. Section 2 explains the difficulty
13、 of splitting a JSP page into fragments. Section 3 gives details of the algorithmto split a JSP page. Section 4 describes the JSP splitting tool that is an implementation of JSP splitting and demonstrates how a sample JS
14、P page is split by the tool. Section 5 shows the experimental results obtained by executing the split JSP fragments with different caching periods on the IBM WebSphere Application Server. Section 6 di</p><p>
15、; 2. Difficulty of Splitting a JSP Page</p><p> In this paper, splitting a JSP page means that some portions of the JSP page are cut from the JSP page and saved as new JSP pages. Such newly created JSP pag
16、es are included in the original JSP page by using some mechanism such as the jsp: include tag. We call the included JSP page the JSP fragment, and call the JSP page that invokes the JSP fragments the master JSP page. A m
17、aster JSP page invokes JSP fragments and receives Web page fragments obtained by executing them. Then the master JSP page m</p><p> JSP fragments are not always executed in the same server or at the same ti
18、me. The application offload technology allows a master JSP page and JSP fragments to be executed in different servers. When the ESI mechanism is used, esi: include tags are put into a Web page fragment obtained by execut
19、ing a master JSP page and interpreted in an edge server that supports the ESI mechanism. In this case, the edge server checks whether or not the Web page fragments specified by esi:include tags exist in its</p>&l
20、t;p> When a JSP page is split into fragments, the following two conditions must be satisfied even if the master JSP page and the JSP fragments are not executed in the same server or at the same time. </p><
21、p> Cond. 1 - 1 The total execution result of a master JSP page and the JSP fragments is the same as the JSP page before it was split.</p><p> Cond. 1 - 2 Each JSP page, which is either a master JSP page
22、 or a JSP fragment, may be executed without other JSP pages. </p><p> These conditions are satisfied by maintaining the data and control dependences existing in a JSP page after the JSP page has been split
23、into fragments. However, it is hard work for developers to detect data and control dependent portions in a JSP page, because the data and control flow of a JSP page can be divided among the JSP page, the JSP engine that
24、executes the JSP page, any Java beans used in the JSP page, and etc.. Thus, a natural solution calls for automatically detecting data-dependent </p><p> The program slicing technique detects a set of progra
25、m statements that affect a program statement S by analyzing the data and control dependences existing in the program. One program slice consists of the detected set of program statements and the statement S. This techniq
26、ue is useful when debugging or maintaining large programs. Since JSP pages are compiled into servlet programs by using a JSP compiler such as the Apache Jasper compiler [4], JSP slices can be obtained by applying program
27、 slicin</p><p> Figure 1 shows a part of a sample JSP page and a sample servlet program compiled from the JSP page. Figure 2 (a) shows the data dependence graph obtained from the servlet program. In a progr
28、am, when a statement S1 assigns a value to a variable and a statement S2 following S1 uses that value, a true data dependence exists between S1 and S2. Such a data dependence is denoted as S1 S2. In Figure 2 (a), due to
29、 the data dependences, the program slice for the statement S10 consists of S1, S9, and S10</p><p> 3. JSP Splitting</p><p> In this paper, we propose JSP splitting, a method of splitting a JSP
30、 page into fragments. The proposed method analyzes data and control dependences in the servlet program compiled from a JSP page. At the time of analysis, JSP splitting takes into account that split JSP pages will be exec
31、uted independently, and may not be executed in the same server or at the same time. First, the portions that developers want to split into a JSP fragment are selected. For the selected portions, the portions need</p&g
32、t;<p> 3.1. Ignorable Data Dependences</p><p> Basically, JSP splitting does not allow the dependent statements to be split apart. However, if this rule is applied too strictly, none of the statemen
33、ts shown in Figure 1 (b) can be split, because there are interlocking dependences starting from S1 and S9. </p><p> Here, we consider how the variable out shown in Figure 1 (b) is used. The variable out is
34、used to write the text data of any Web page. Note that the value of out can be retrieved from any JSP engine. When a master JSP page JM includes a JSP fragment JF by using a jsp:include tag and a JSP engine executes both
35、 of them, JM first retrieves the value of out from the JSP engine and writes its own text data to the value. Next, JM invokes JF. After being invoked, JF also retrieves the value of out and </p><p> As show
36、n in Figure 2 (a), none of the statements can be split while maintaining the data dependences existing in the servlet program shown in Figure 1 (b). However, if the data dependences for the variable out are ignored, the
37、data dependence graph is changed as shown in Figure 2 (b). Using the data dependence graph shown in Figure 2 (b) makes it possible to split S2 from the set of S9, S10, S11, and S12 which cannot be split due to the data d
38、ependences for the variable book.</p><p> In servlet programs compiled by the Apache Jasper compiler, the data dependences for the variables shown in Table1 can be ignored for the same reason as for the var
39、iable out.Since the values of these variables are defined at the top of each servlet program and are frequently referred to, most statements cannot be split if the data dependences are to be maintained.</p><p&
40、gt; In general, the out-of-order execution is allowed for the statements without data and control dependences. Ignoring the data dependences for the variables shown in Table 1 may introduce an incorrect execution order
41、of statements. For example,if S10 and S12 shown in Figure 1 are split into a JSP fragment and the JSP fragment is included before S11, an incorrect Web page is generated. In order to avoid such incorrect execution, our a
42、lgorithm does not allow changes in the order of the statements th</p><p> 3.2. Analysis of Data Dependences for Java beans</p><p> In a JSP page, Java beans are frequently used to store and re
43、trieve data as property values. Each Java bean is a Java object and developers can use Java beans by using three kinds of tags in a JSP page.</p><p> ● jsp:useBean: Declares a named Java bean with its scope
44、. When an object for the Java bean does not exist within the declared scope, the bean is instantiated. Java beans can be declared with the scope of page, request,session or application.</p><p> ● jsp:getPro
45、perty: Calls the get method of a Java bean object and retrieves the property value.</p><p> ● jsp:setProperty: Calls the set method of a Java bean object and sets the property value.</p><p> J
46、ava beans must be declared with the jsp:useBean tag before the other two operations. This means that a declaration of a Java bean and all of the other operations for the Java bean must be included in the same JSP page. T
47、his strongly limits the extent of a JSP fragment. In order to relax the limitation, JSP splitting allows declarations of Java beans to be copied to JSP fragments. The reason why declarations of Java beans can be copied i
48、s that the declarations do not have side effects. Each decl</p><p> When a property value is set for a Java bean by using a jsp:setProperty tag and retrieved from the JSP bean by using a jsp:getProperty tag
49、, a true data dependence exists between the two operations.When the rule that data dependent statements cannot be split is applied, data dependent operations for a Java bean must be included in the same fragment. However
50、, a data dependence between an operation that sets a property value for a JSP bean and another operation that retrieves the property value is </p><p> Cond. 2 - 1 The scope of the Java bean is ”request”, ”s
51、ession”, or ”application”.</p><p> Cond. 2 - 2 The split JSP pages are executed in the same JSP engine.</p><p> If these conditions are satisfied, JSP splitting allows the operations among whi
52、ch the data dependences exist to be split into different JSP pages, because the Java bean lives in the JSP engine during the execution of the split JSP pages. As a result, the portions split along with the portions selec
53、ted by a developer can be reduced. However, the Web page fragments obtained by executing the split JSP pages satisfying these conditions must have the same caching period. This is because the data dep</p><p>
54、; When a Java bean has the page scope, the dependent operations for the Java bean cannot be split. However, each operation that sets a property value for a Java bean with the page scope can be copied along with one or m
55、ore operations that retrieve the same property value, because the operations that set property values for Java beans with the page scope do not have side effects.</p><p> Figures 3 to 6 show the algorithms
56、to split the operations for Java beans. These algorithms try to minimize the number of the operations that are moved or copied to a JSP fragment.</p><p> 4. JSP Splitting Tool</p><p> We imple
57、mented JSP splitting as a plug-in for Eclipse。Figure 7 shows the architecture of the JSP splitting tool. The JSP splitting editor presents the source view and the outline view of a JSP page. Developers select the portion
58、s that they want to split using either the editor or the outline. After the portions are selected by developers, the moved and copied portions are displayed in a dialog with the selected portions. All of the portions are
59、 put into a new JSP page specified by developers, an</p><p> When the editor is invoked with a JSP page, the data and control dependences existing in the JSP page are analyzed. First, the JSP compiler, whic
60、h is based on the Apache Jasper compiler, compiles a JSP page into a servlet program. The JSP compiler partitions the JSP page into the parts that are categorized as shown in Table 2, and generates one or more Java state
61、ments for each part. At this time, the mapping table between each part of the JSP page and one or more statements of the servlet progra</p><p> The JSP-Servlet mapper converts the original groups, each of w
62、hich contains dependent statements of a servlet program, into new groups, each of which contains the dependent JSP parts, by using the mapping table between the parts of a JSP page and the statements of the servlet progr
63、am.</p><p> This mapping table was generated earlier during the JSP compilation stage. The generated JSP groups are passed to the JSP splitter.</p><p> 5. Experiment</p><p> We m
64、easured the execution performance of JSP pages split by using our tool. The JSP page was executed on WebSphere Application Server, with the Dynacache mechanism enabled. For comparison, we split all of the portions that d
65、ynamically output Web page fragments into just one JSP fragment, and did not cache the Web page generated from the JSP fragment, because the generated Web page included the private information from the fragment. However,
66、 the other text fragments were cached for 30 seconds. We</p><p> 6. RelatedWork</p><p> As mentioned in Section 2, the program slicing technique is similar to our method. However, the program
67、slicing technique does not assume that each sliced program is executed as an independent program though the total execution result of the sliced programs has to be the same as the program before it was sliced. Therefore,
68、 the program slicing technique cannot be applied to the splitting of JSP pages.</p><p> The Extract Method is a software refactoring technique that converts several program statements into a newmethod. This
69、 technique increases the chances that other methods can use the extracted methods. The statements converted into a method are selected by developers. This technique is similar to our method. After the statements are sele
70、cted, the parameters that must be passed to the new method, and the return value of the new method are determined.</p><p> 7. Conclusion</p><p> In this paper, we proposed JSP splitting as a m
71、ethod of splitting a JSP page into fragments in order to improve the execution performance and the reusability of the JSP pages. In the future, we are going to introduce a method that compensates for this lack of informa
72、tion by interacting with developers.</p><p><b> 中文翻譯稿</b></p><p> 翻譯: 應用技術學院 06計算機科學與技術(0616403057) 傅曉燕</p><p><b> 2010年2月</b></p><p> ?。ㄖ形拿?/p>
73、改進執(zhí)行性能的JSP切分)</p><p><b> 摘要</b></p><p> 當網(wǎng)頁應用服務器能分別存儲通過執(zhí)行JSP片段獲得的網(wǎng)頁頁面片段時,把一個JSP(Java服務器頁面)頁面切分成若干個片段能改進JSP頁面的執(zhí)行性能。如果一個JSP頁面根據(jù)通過執(zhí)行JSP頁面獲得的網(wǎng)頁頁面的每一個部分的不斷跟新被切成若干片段,所有切分的JSP片段不需要被再次執(zhí)行,只
74、有當需要調(diào)用的網(wǎng)頁片段在緩存中過期了。另外,一個JSP頁面的片段能夠被其他的JSP頁面再次使用。在這兩種情況下,所有的從JSP頁面中切分的JSP片段的執(zhí)行結(jié)果必須與在JSP頁面切分之前一樣。在這篇文章中,本文提出JSP切分,它是一種把JSP頁面切分成片段的方法,維持了存在于源JSP頁面的數(shù)據(jù)和控制依賴。JSP切分自動檢測了需要維持JSP頁面的數(shù)據(jù)和控制依賴的部分,因為開發(fā)者想要從JSP頁面中切分這部分。我們使用GUI工具實施JSP切分,
75、并且證實切分的JSP片段和JSP頁面切分之前是以同一方式執(zhí)行的。實驗結(jié)果顯示通過切分一個JSP頁面為片段和為通過執(zhí)行JSP片段獲得的網(wǎng)頁片段設置不同的存儲方法能夠減少訪問網(wǎng)頁的響應時間。</p><p><b> 1.引言</b></p><p> 當網(wǎng)頁應用服務器能夠分別的存儲通過執(zhí)行JSP頁面的片段獲得的網(wǎng)頁片段時,把一個JSP頁面切分成若干片段能改善一些JS
76、P頁面的執(zhí)行性能。由于內(nèi)容的動態(tài)性,通過JSP引擎產(chǎn)生的存儲動態(tài)網(wǎng)頁的方法是受限的。當通過JSP引擎產(chǎn)生的網(wǎng)頁的存儲內(nèi)容被更新,整個JSP頁面必須在應用服務器上再次被執(zhí)行,盡管網(wǎng)頁的改變可能很小。由于存儲網(wǎng)頁的不斷更新增加應用服務器上的負載,它合理的把JSP頁面切分成為若干個片段,并且為通過執(zhí)行JSP片段獲得的網(wǎng)頁片段設置不同的存儲方法。當然,網(wǎng)頁片段必須被正確的合并為一個最終的網(wǎng)頁。IBM的WebSphere應用服務器的動態(tài)緩存技術允
77、許網(wǎng)頁片段有不同的存儲方法。由Apache Jakarta項目提供的存儲標簽庫也為JSP片段支持不同的存儲方法。另外,ESI(Edge Side Includes)技術為使用不同的存儲方法存儲網(wǎng)頁片段提供了一個機制,并且在一個邊緣服務器上把他們合并成一個最終的網(wǎng)頁。</p><p> IBM的WebSphere 邊緣服務器的應用卸載技術是改善JSP頁面執(zhí)行性能的另一種方法。這種技術允許一個或多個JSP片段在邊緣
78、服務器上存儲或執(zhí)行。其余的JSP片段部署在應用服務器上并且訪問在邊緣服務器上執(zhí)行的JSP片段。因此,一些JSP頁面的執(zhí)行被下載到邊緣服務器上。</p><p> 切分一個JSP頁面便于JSP片段的重用。當一個網(wǎng)頁應用包含許多JSP頁面時,相同的部分傾向于存在許多的JSP頁面中。例如框架,橫幅,標題等。</p><p> 當一個JSP頁面被切分發(fā)為若干個片段時,所有片段的總的執(zhí)行結(jié)果必須
79、與在切分之前是一樣的。另外,當JSP頁面的片段在不同的服務器上執(zhí)行時,每一個片段需要在沒有其他片段的時候執(zhí)行。為了滿足這些條件,我們提出了JSP切分,它是一種在本文中描述的把一個JSP頁面切分成若干片段的方法,由于為了一些特別的目的很難自動的找到最好的方法來把JSP頁面切分成若干個片段,我們假設開發(fā)者會選擇他們想要切分的片段的那部分。為了正確的執(zhí)行所有分開的JSP頁面,JSP切分自動地檢測了一些部分,那些部分必須和一些選擇的部分被移動或
80、復制到一個片段中。這個檢測是基于對存在于JSP頁面中的數(shù)據(jù)和控制依賴做的。JSP切分類似于程序切片技術,它是基于數(shù)據(jù)和控制依賴切一個程序的。然而,程序的切片技術沒有考慮到被切的程序能被獨立的執(zhí)行,以及切的程序的總的執(zhí)行結(jié)果必須和沒有分離以前是一致的。另外,由于數(shù)據(jù)在JSP頁面的執(zhí)行中被傳送到JSP引擎,JSP引擎的源程序,例如Apache Tomcat,為了正確的分析數(shù)據(jù)依賴是必須的。這是不切實際的,因為JSP引擎的源程序是非常大而且復
81、雜的。JSP切分通過利用JSP特征避免了JSP引擎的分</p><p> 這篇文章的其余編排如下。章節(jié)2解釋了把JSP頁面切分成若干個片段的難點。章節(jié)3給出了切分一個JSP頁面算法的詳情。章節(jié)4描述了JSP切分工具是JSP切分的實現(xiàn)工具并演示了由這個工具是如何把一個JSP例子切分的。章節(jié)5顯示了通過在IBM WebSphere應用服務器上使用不同的存儲方法來執(zhí)行切分JSP片段獲得的實驗的結(jié)果。章節(jié)6討論有關我們
82、的貢獻的先前的工作。最后一章節(jié)是結(jié)論。</p><p> 2.切分JSP頁面的難點</p><p> 在這篇文章中,切分一個JSP頁面意味著JSP頁面的一些部分是從JSP頁面中切出來的并且保存為新的JSP頁面。這種新的創(chuàng)建JSP頁面包括使用一些如jsp(包括標簽)的源JSP頁面。我們稱包含的JSP頁面為JSP片段,并且稱調(diào)用JSP片段的JSP頁面為主JSP頁面。一個主JSP頁面調(diào)用JS
83、P片段并且接受通過執(zhí)行他們獲得的網(wǎng)頁片段。然后主JSP頁面合并它自己的網(wǎng)頁片段和從JSP片段中接收的網(wǎng)頁片段,并且創(chuàng)建了一個最終的網(wǎng)頁。</p><p> JSP片段不是總是在同一服務器和同一時間執(zhí)行的。應用卸載技術允許主JSP頁面和JSP片段在不同的服務器上執(zhí)行。當ESI機制被使用,ESI:包括標簽被放入通過執(zhí)行一個主JSP頁面獲得的網(wǎng)頁片段和在邊緣服務器上解釋來支持ESI機制。在這種情況下,邊緣服務器會檢查
84、是否是由ESI指定的網(wǎng)頁片段:包括存在于它的緩存中的標簽。如果網(wǎng)頁片段的內(nèi)容沒有被存儲或者已經(jīng)滿了,JSP片段會從邊緣服務器調(diào)用,并且在一個或多個應用服務器上執(zhí)行。如果不同的存儲方法能夠考慮通過執(zhí)行JSP片段獲得的網(wǎng)頁片段。每一個JSP片段只有在存儲的內(nèi)容滿時才被執(zhí)行。這種動態(tài)存儲技術,ESI機制,和存儲標簽庫能夠為網(wǎng)頁片段提供的不同的存儲方法。</p><p> 當JSP頁面被切分成若干片段,下面的兩個條件必
85、須滿足,即使主JSP頁面還是JSP片段沒有在同一服務器和同一時間執(zhí)行。</p><p> 條件. 1-1 主JSP頁面和JSP片段的最終執(zhí)行結(jié)果要和JSP頁面被切分之前一致。</p><p> 條件. 1-2 每一個JSP頁面,無論是一個主JSP頁面還是一個JSP片段,能夠在沒有其它JSP頁面下執(zhí)行。</p><p> 這些條件通過維持存在于JSP頁面被切分成
86、片段后的數(shù)據(jù)和控制自由來滿足。然而,對開發(fā)者來說在一個JSP頁面中監(jiān)測數(shù)據(jù)和控制依賴是困難的,因為JSP頁面的數(shù)據(jù)和控制流量能夠在JSP頁面中被分開,JSP引擎執(zhí)行JSP頁面,一些Java beans在JSP頁面中被使用等等。因此,一個自然的解決方法需要自動地檢測連接到開發(fā)者想要切分的那部分的數(shù)據(jù)依賴和控制依賴。</p><p> 程序的切片技術檢測了一組程序申明,它通過分析存在于程序中的數(shù)據(jù)和控制依賴來影響程
87、序申明S。一個程序片包含了檢測的一組程序申明和申明S。當調(diào)試和維護大的程序時,這個技術是有用的。因為JSP頁面通過使用如Apache Jasper編譯器那樣的編譯器被編譯成servlet程序,JSP切分能夠通過應用程序分化技術到JSP頁面中編譯的servlet中獲得。然而,程序切片技術不足以切分一個JSP頁面為片段,因為這個技術沒有考慮到程序切片被獨立的執(zhí)行。</p><p> 圖1顯示了JSP頁面例子的一部分
88、和從JSP頁面中編譯的servlet 程序的例子。圖2(a)顯示了從servlet程序中獲得的數(shù)據(jù)依賴圖表。在這個程序中,當申明S1分配一個值到一個變量和申明S2跟S1使用那個值,一個真的數(shù)據(jù)依賴存在于S1和S2之間。這樣一個數(shù)據(jù)依賴被記為S1->S2。在圖2(a),基于數(shù)據(jù)依賴,對于申明S10的程序片包含S1,S9和S10。如果程序片是從servlet程序中切的,剩下的程序申明就有錯誤因為數(shù)據(jù)依賴S1->S2,S11和S1
89、2和S9->S11和S12是沒有實踐。因此,程序切片技術對于切分JSP頁面沒有做的很好。</p><p> (a) JSP頁面部分</p><p> ?。╞)servlet程序部分</p><p> 圖1.一個JSP頁面例子和一個從JSP頁面中編譯得到的servlet程序</p><p> ?。╝)正常的
90、 (b)對out忽略數(shù)據(jù)依賴</p><p> 圖2. 數(shù)據(jù)依賴圖標</p><p><b> 3.JSP切分</b></p><p> 在這篇文章中,本文提出JSP切分,把JSP頁面切分成若干片段的一個方法。這個提出的方法分析了從JSP頁面中編譯的servlet程序的數(shù)據(jù)和控制依賴。在分析的時候,JSP切分考慮到切分JSP頁面會被獨立
91、的執(zhí)行,并且可能不會在同一服務器和同一時間執(zhí)行。首先,開發(fā)者想要切分為JSP片段的那部分被選擇了。對于選擇的部分需要滿足條件1-1和1-2來被檢測。被檢測的部分要被分類到轉(zhuǎn)移和復制的部分,并且為了滿足開發(fā)者的意圖要被最小化。</p><p> 3.1不容忽略的數(shù)據(jù)依賴</p><p> 基本上,JSP切分不允許依賴的申明被分別的切分。然而,如果這個規(guī)則太嚴格的被應用,在圖1(b)中顯示
92、的申明沒有能被分化的,因為從S1到S9開始有交錯的依賴。</p><p> 這里,我們考慮在圖1(b)里顯示的變量out是怎樣使用的。變量out用于寫一些網(wǎng)頁的文本數(shù)據(jù)。注意out的值能夠從一些JSP引擎中檢索。當一個主JSP頁面(Jm)包含通過使用JSP得到的JSP片段Jf:包括標簽和JSP引擎兩個都執(zhí)行,Jm首先檢索JSP引擎中的out的值并且寫它自己的文本數(shù)據(jù)到這個值。接下來,Jm調(diào)用Jf。在被調(diào)用后,J
93、f也檢索out的值并且寫它自己的文本數(shù)據(jù)到這個值。通過Jf寫的文本數(shù)據(jù)通過JSP引擎被返回到Jm,并且與Jm寫的文本數(shù)據(jù)合并。這意味著out的值能夠被一些JSP頁面使用并且寫入這個值的文本數(shù)據(jù)由JSP引擎維持。換句話說,當JSP頁面被切分成為片段時,檢索out的值申明能夠存在于從主JSP頁面編譯的servlet程序和從JSP片段編譯的servlet程序。因此,對于變量out的數(shù)據(jù)依賴在切分JSP頁面時能夠被忽略。</p>
94、<p> 正如在圖2(a)中顯示的,當維持存在于圖1(b)中顯示的servlet程序的數(shù)據(jù)依賴時沒有申明能被切分。然而,如果對于變量out的數(shù)據(jù)依賴被忽略,那么數(shù)據(jù)依賴圖表就會像圖2(b)中顯示的那樣被改變。像圖2(b)中顯示的那樣使用數(shù)據(jù)依賴圖表使得從組S9,S10,S11和S12中切分S2變得可能,它不能夠依據(jù)變量book的數(shù)據(jù)依賴被分化。</p><p> 在被Apache Jasper編譯器
95、編譯的servlet程序中,對于表1里顯示的變量的數(shù)據(jù)依賴能和變量out相同的原因被忽略。由于這些變量的值被定義在每個servlet程序的最高端并且被頻繁的提到,如果數(shù)據(jù)依賴能夠被保持,那么大多數(shù)申明不能被切分。</p><p> 一般來講,無序執(zhí)行對于沒有數(shù)據(jù)控制依賴的申明是允許的。忽略在表1里顯示的變量的數(shù)據(jù)依賴可能會產(chǎn)生申明的一個錯誤的執(zhí)行順序。例如,如果在圖1中顯示的S10和S11被切分成一個JSP片段
96、,并且這個JSP片段在S11之前被包含了,一個錯誤的網(wǎng)頁就會產(chǎn)生。為了避免這種錯誤的執(zhí)行結(jié)果,由于已經(jīng)忽略了數(shù)據(jù)依賴的申明,我們的算法不允許改變。</p><p> 表1.這些變量的數(shù)據(jù)依賴被忽略</p><p> 3.2.對于Java beans數(shù)據(jù)依賴的分析</p><p> 在一個JSP頁面中,Java beans作為屬性值被頻繁的用來存儲和檢索數(shù)據(jù)。每
97、一個Java bean是一個Java項目并且開發(fā)者能夠通過使用JSP頁面中的三種標簽來使用Java beans。</p><p> ●jsp:使用Bean:在它的范圍內(nèi)申明一個Java bean。當這個Java bean的項目不在它申明的范圍內(nèi),這個bean就會被實例化。Java beans能夠申明在頁面,請求,節(jié)或者應用的范圍內(nèi)。</p><p> ●jsp:獲得屬性:稱為獲得Jav
98、a bean項目的方法并且檢索屬性值。</p><p> ●jsp:設置屬性:稱為設置Java bean項目的方法并且設置屬性值。</p><p> Java beans必須用jsp申明:在另兩個操作之前使用Bean標簽。這意味著Java bean的申明和Java bean的所有其他的操作必須包含在同一JSP頁面中。這大大限制了JSP片段的范圍。為了緩和這個限制。JSP切分允許Java
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 個人博客網(wǎng)站設計畢業(yè)
- 個人博客網(wǎng)站課程設計
- 個人博客網(wǎng)站畢業(yè)設計
- 個人博客網(wǎng)站設計畢業(yè)論文
- 個人博客系統(tǒng)畢業(yè)論文--博客網(wǎng)站的設計與實現(xiàn)
- 個人博客網(wǎng)站畢業(yè)論文
- 個人博客網(wǎng)站畢業(yè)論文
- 個人博客網(wǎng)站畢業(yè)論文
- 畢業(yè)設計--個人博客網(wǎng)站的設計與實現(xiàn)
- 個人博客網(wǎng)站的設計與實現(xiàn)畢業(yè)設計
- 個人博客網(wǎng)站的設計與實現(xiàn) 畢業(yè)論文
- 外文翻譯--博客系統(tǒng)
- javaweb課程設計報告--個人博客網(wǎng)站的實現(xiàn)(java)
- 博客網(wǎng)站畢業(yè)設計
- 畢業(yè)設計-博客網(wǎng)站
- 什么是博客【外文翻譯】
- 網(wǎng)站畢業(yè)設計外文翻譯
- 網(wǎng)站外文翻譯
- jsp技術網(wǎng)站設計外文翻譯
- 網(wǎng)站設計與架構[外文翻譯]
評論
0/150
提交評論