freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

java自測在線考試系統(tǒng)設計與實現(xiàn)畢業(yè)論文-資料下載頁

2025-06-28 08:01本頁面
  

【正文】 a scope by adding your own sets of curly braces ({...}) around variable definitions. These braces can even begin and end in different sets of scriptlet tags.In the following example, I replace a few of the static dates in the original XML file with some Java code using the Calendar class. The code uses the current date and adds hours and minutes along the way to create the appropriate time entries for several of the XML tags. The Java code is boldfaced. Line numbers are added for reference later.Here39。s what39。s happening in this code segment:The page directive is added to indicate that the response generated by the page servlet will contain XML.The Calendar variable cal is defined to contain the current date and time.Using the global out object, we can print directly into the current position of the page being sent as the response. We print the current time stamp back into the page. Note that when the response is generated, the JSP scriptlet tags will be replaced with the time stamp result.We add 10 minutes to the current time and print the result to the page as the departure time.We add 4 hours to the current time to derive the scheduled arrival time of the flight, which is then printed to the page using the out object. Afterwards, we add another 2 minutes to create the actual arrival time.The equals sign with the scriptlet tags (%=...%) will cause the result of anything contained within the tags to be printed to the page. The line in the example is equivalent to the following line using the standard scriptlet tag:Note that the cal object is global to the entire page, even though it is used in a different set of scriptlet tags from where it is defined. As I mentioned before, unless you add braces ({...}) to enforce scope, variable declarations are global to the entire page from the point of declaration.Also, the Java code in this example is used primarily to generate data between XML tags. We could also use Java code to generate entire trees of tags in an XML document. The code must simply print out the tags in addition to the data. This is what lines 1517 do.Adding JavaBeans ponentsThe JSP syntax supports adding JavaBeans ponents to the page and accessing them like any other Java object. The special jsp:useBean tag is used to declare and instantiate the bean. The page piler will use the attributes of the jsp:useBean tag to build the Java code in the page servlet, which is necessary to instantiate the bean and populate it with data from the request. Because JavaBeans ponents are generically meant to perform a task, it39。s easy to see how they can be used to perform or interface with plex business logic, moving the plex Java code out of the JSP page. One example is an Integration Object JavaBean ponent. This bean was built using IBM WebSphere Host Publisher, which encapsulates interactions with legacy data sources, such as 3270 applications or databases, and simply returns their data. Imagine using an Integration Object that interfaces with a hostbased airline scheduling application to provide the arrival and departure information in our example. As a user of the Integration Object, you simply request the itinerary data from it, unaware of the plex munication and interactions with the host application that occur in the background. Let39。s take a closer look at what39。s going on in this sample.Contains the jsp:useBean tag that defines and instantiates the bean as flightInfo. The next line contains a scriptlet that calls the doHPTransaction() method of flightInfo, causing it to connect to the host flight information application and retrieve pertinent flight information. Lines 13, 16, 25, and 28 simply insert the results back into the XML document.You can use other types of beans in exactly the same manner, perhaps calling some other invocation method besides doHPTransaction() to do the work. You can even add multiple beans to the same document, creating a posite XML view of data from multiple sources.ConclusionJavaServer Pages technology has been an open standard for several years and has been widely used for generating dynamic HTML documents. Few have realized that the same flexibility of embedding actual Java code within an HTML document can be applied to generating XML. Consider the possibilities. You could streamline B2B munications by dynamically building only the data that changes. You might build various representations of data from one data source, not just HTML and XML, but WML and HDML for wireless protocols, or simply use products like WebSphere Transcoding Publisher to convert your dynamic XML to deviceappropriate representations.XML clearly has been embraced as the mon format for data interchange. Using JavaServer Pages technology provides a powerful tool for sending your data over the Web in XML quickly and easily.附 錄 A 外文譯文Web 應用程序開發(fā)人員傳統(tǒng)上使用 JSP 技術動態(tài)構建 HTML,方法是將 Java 代碼包括在 HTML 源代碼中。但您知道可以使用同樣的方法生成 HTML 之外的動態(tài)內(nèi)容嗎?您可以實現(xiàn)這一點,而且方法比較簡單??梢允褂?XML 文檔構建 JSP 頁面,該 XML 文檔將用作輸出模板,然后替換必須基于基層業(yè)務邏輯動態(tài)生成的部分。為了生成文檔的動態(tài)部分,您既可以使用直接編寫在 JSP 頁面中的 Java 代碼,也可以使用從該頁面外部調(diào)用的 Java 代碼。生成文檔的哪些部分由您控制。例如,您可以使用 Java 代碼生成兩個 XML 標記之間的數(shù)據(jù),生成 XML 文檔樹的各個部分(標記和數(shù)據(jù)),甚至可以生成整個文檔。Java 代碼被從頁面中除去,并被加工成一個 servlet(稱為頁面 servlet),然后 Java 應用程序服務器將其作為 JSP 頁面請求的一部分運行。得到的結果是純 XML。JSP 技術概述讓我們先對 JSP 頁面的工作方式作一些簡單的討論。我們將力求簡單,只將注意力集中于一些基本的方面。從傳統(tǒng)意義上講,JSP 頁面與 HTML 頁面很相似,只是多了一些標記。這些標記使設計人員能夠?qū)?Java 代碼(不是 JavaScript)嵌入到頁面中。Web 應用程序服務器(如 IBM WebSphere Application Server)將截取對 JSP 頁面的請求。頁面的擴展名 .jsp(不是 .html)向應用程序服務器暗示了這些標記的存在。Web 應用程序服務器隨后對 JSP 頁面進行預處理,提取其中的 JSP 標記和任何內(nèi)嵌的 Java 代碼,而只保留 HTML。提取出來的 JSP 標記和內(nèi)嵌 Java 代碼用來構建 Java servlet(JSP 頁面 servlet),Java servlet 運行該代碼并將結果插入到原頁面中 JSP 標記所在的位置。得到的結果是純 HTML。在請求瀏覽器看到任何結果之前,Java 代碼被剝離并在服務器上運行。我們可以將同樣的原理應用于 XML 頁面。在包含 XML 的 JSP 頁面的請求者(可能是一個瀏覽器,也可能是某個企業(yè)對企業(yè)的應用程序)看到 XML 之前,Java 代碼被剝離 JSP 頁面并用來生成其他內(nèi)容,生成的內(nèi)容被插入到 JSP 標記原來所在的頁面位置。這種特性使您能夠精確地控制將新內(nèi)容插入到什么位置,甚至可以精確到單個字符。過一會兒我們將考慮如何使用以上的特性。首先,讓我們考慮為什么您可能會想到用 JSP 創(chuàng)建動態(tài) XML。為什么不只是
點擊復制文檔內(nèi)容
環(huán)評公示相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1