JSP技術(shù)方法及語法_第1頁
JSP技術(shù)方法及語法_第2頁
JSP技術(shù)方法及語法_第3頁
JSP技術(shù)方法及語法_第4頁
JSP技術(shù)方法及語法_第5頁
已閱讀5頁,還剩10頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、出處:thinking in javawilliam gibsonjsp的技術(shù)方法為了快速方便地進行動態(tài)網(wǎng)站的開發(fā),jsp在以下幾個方面做了改進,使其成為快速建 立跨平臺的動態(tài)網(wǎng)站的首選方案。1 .將內(nèi)容的生成和顯示進行分離用jsp技術(shù),web頁面開發(fā)人員可以使用html或者xml標識來設計和格式化最終 頁面,并使用jsp標識或者小腳本來生成頁面上的動態(tài)內(nèi)容(內(nèi)容是根據(jù)請求變化的,例如 請求賬戶信息或者特定的一瓶酒的價格等)。生成內(nèi)容的邏輯被封裝在標識和javabeans組 件中,并且捆綁在腳本中,所有的腳本在服務器端運行。由于核心邏輯被封裝在標識和 javabeans屮,所以web管理人員和

2、頁面設計者,能夠編輯和使用jsp頁而,而不影響內(nèi)容 的生成。在服務器端,jsp引擎解釋jsp標識和腳本,生成所請求的內(nèi)容(例如,通過訪問 javabeans組件,使用jdbc技術(shù)訪問數(shù)據(jù)庫或者包含文件),并且將結(jié)果以html (或者 xml)頁面的形式發(fā)送冋瀏覽器。這既有助于作者保護自己的代碼,又能保證任何基于 html的web瀏覽器的完全可用性。2. 可重用組件絕大多數(shù)jsp頁血依賴于可重用的、跨平臺的組件(javabeans或者enterprise javabeans 組件)來執(zhí)行應用程序所要求的復雜的處理。開發(fā)人員能夠共享和交換執(zhí)行普通操作的組件, 或者使得這些組件為更多的使用者和客戶團

3、體所使用?;诮M件的方法加速了總體開發(fā)過 程,并且使得各種組織在他們現(xiàn)有的技能和優(yōu)化結(jié)果的開發(fā)努力中得到平衡。3. 采用標識web頁面開發(fā)人員不會都是熟悉腳本語言的編程人員。jsp技術(shù)封裝了許多功能,這些 功能是在易用的、與jsp相關(guān)的xml標識中進行動態(tài)內(nèi)容牛成所需要的。標準的jsp標識 能夠訪問和實例化javabeans組件,設置或者檢索組件屬性,下載applet,以及執(zhí)行用其他 方法更難于編碼和耗時的功能。4. 適應平臺幾乎所有平臺都支持java, jsp+javabeans幾乎可以在所有平臺下通行無阻。從一個平 臺移植到另外一個平臺,jsp和javabeans甚至不用重新編譯,因為ja

4、va字節(jié)碼都是標準的 與平臺無關(guān)的。5. 數(shù)據(jù)庫連接java >i«連接數(shù)據(jù)庫的技術(shù)是jdbc, java程序通過jdbc驅(qū)動程序與數(shù)據(jù)庫相連,執(zhí)行 查詢、提取數(shù)據(jù)等操作。sim公司還開發(fā)了 jdbcodbc bridge,利用此技術(shù)jam程序可 以訪問帶有odbc驅(qū)動程序的數(shù)據(jù)庫,目前大多數(shù)數(shù)據(jù)庫系統(tǒng)都帶有odbc驅(qū)動程序,所 以java程序能訪問諸如oracle、sybase、ms sql server和ms access等數(shù)據(jù)庫。此外,通過開發(fā)標識庫,jsp技術(shù)可以進一步擴展。第三方開發(fā)人員和其他人員可以為 常用功能創(chuàng)建自己的標識庫。這使得web頁面開發(fā)人員能夠使用熟悉的

5、工具和如同標識一 樣的執(zhí)行特定功能的構(gòu)件來進行工作。jsp技術(shù)很容易整合到多種應用體系結(jié)構(gòu)中,以利用現(xiàn)存的工具和技巧,并且能擴展到 支持企業(yè)級的分布式應用中。作為采用java技術(shù)家族的一部分,以及java 2 (企業(yè)版體系 結(jié)構(gòu))的一個組成部分,jsp技術(shù)能夠支持高度復雜的基于web的應用。由于jsp頁面的 內(nèi)置腳本語言是基于java的,而ii所有的jsp頁面都被編譯成為java servlets,所以jsp頁 血具有java技術(shù)的所有好處,包括健壯的存儲管理和安全性。作為java平臺的一部分,jsp 擁有java編程語言“一次編寫,各處運行”的特點。jsp的應用模型利用jsp技術(shù),動態(tài)信息由

6、jsp頁面來表現(xiàn),jsp頁面由安裝在web服務器或者使用 jsp的應用服務器上的jsp引擎執(zhí)行。jsp引擎接受客戶端對jsp頁血的請求,并且生成jsp 頁面作為對客戶端的響應。jsp頁面通常被編譯成為java servlets,這是一個標準的java擴展。頁面開發(fā)人員能夠 訪問全部的java應用環(huán)境,以利用java技術(shù)的擴展性和可移植性。當jsp頁面第一次被調(diào) 用時,如果它還不存在,就會被編譯成為一個java servlets類,并且存儲在服務器的內(nèi)存中。 這就使得在接下來的對該頁面的調(diào)用中,服務器會有非??斓捻憫?這避免了 cgi-bin為 每個http請求生成一個新的進程的問題)。jsp頁

7、面可以包含在多種不同的應用體系結(jié)構(gòu)或者模型中,可以用于由不同協(xié)議、組件 和格式所組成的聯(lián)合體屮。基于jsp的動態(tài)信息發(fā)布技術(shù)是一個開放的、可擴展的建立動態(tài) web頁面的標準。不論采用什么創(chuàng)建工具,開發(fā)人員都可以使用jsp頁面來創(chuàng)建可移植的 web應用,在不同的web應用服務器上運行。jsp computing techniqueto carry on the dynamic website conveniently fast the development, jsp has made the improvement in the following several aspects, cause

8、s it to become builds the cross platform fast the dynamic website first choice plan.1. carries on the separation the con tent production and the demonstrationwith the jsp technology, the web page development personnel may use html or the xml marking design and the fonnatted final page, and uses the

9、jsp marking or the tootsy produces on page's dynamic content (content is originally acts according to request change, for example request account information or a specific bottle of liquor price and so on). production contents logic is sealed in marks and in the javabeans module, and ties up in

10、the script, all scripts in server end movement. because core logic is sealed in marks and in javabeans, therefore the web administrative personnels and the page designer, can edit and use the jsp page, but does not affect the content the production, in the server end, the jsp engine explained that t

11、he jsp marking and the script, produce the content which requested (e.g,through visits the javabeans module, uses jdbc technology visit database or included file), and (or xml) page's form transmits the result by html the browse匚 this both are helpful in the author protects own code, and can gua

12、rantee any based on the html web browser's complete usability2. may entrust with heavy responsibility the modulethe overwhelming majority jsp page relies on may ust with heavy responsibility, the cross platform module (javabeans or enteiprise the javabeans module) carries out complex processing

13、which the application procedure requests the development personnel can share and 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 modules method, and causes each kin

14、d of organization obtai ns balanced in their existing skill and in the optimized result development endeavor.3. uses markingthe web page development personnel will not be the familiar script language programmers. the jsp technology has sealed many functions, these functions are easy to use, marking

15、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 retrieval module attribute, downloads applet, as well as the execution difficulty with codes and the time-consuming funct

16、ion with other methods.4. adapts the platformnearly all platforms 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 code is standard has noth

17、ing to do with the platform5. database connectionin java connects the database the technology is the jdbc, java procedure is connected through the jdbc driver and the database, operations and so on execution inquiry, extraction data. sun corporation has also developed jdbc-odbc bridge, uses this tec

18、hnical java procedure to be possible to visit has the odbc driver database, 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, in addition, through the development marking stor

19、ehouse, the jsp technology may further expand the third party development personnel and other personnel may found their marking storehouse for the commonly used function. this enables the web page development personnel to be able to use the familiar tool and to be similar to marking same carries out

20、 the specific function component to carry on the work.the jsp technology very easy conformity to many kinds of application architecture, to use the extant tool and the skill, and can expand to the support enterprise distributional application. as uses the java technology family a part, as well as ja

21、va 2 (enteiprise version architecture) a constituent, the jsp technology can support highly complex based on the web application. because the jsp page's built-in script language is based on java, moreover all jsp page is translated into java servlets, therefore the jsp page has java technology a

22、ll advantage, including vigorous and healthy store management and security. as a java platform's part, jsp has the java programming language “a compilation, each place movement characteristicjsp application modelusing the jsp technology, the dynamic information displays by the jsp page, the jsp

23、page by installs, in the web server or uses jsp on the application servers jsp engine execution the jsp engine accepts the client side to the jsp page's request, and produces the jsp page to take to the client side response.the jsp page is usually translated into java servlets, this is a standar

24、d java expansion. the page development personnel can visit the complete java application environment, uses the java technology the extension and the probability when the jsp page first time is transferred, if it has not existed, will be translated into java the servlets kind, and will save in server

25、s memory. this causes in following to this pagefs transfer, the server could have the very quick response (this to avoid cgi-bin is each http request produces a new advancement question).the jsp page may contain in many kinds of different application architecture or the model, may use in the unified

26、 body which by the different agreement, the module and the form is composed based on the jsp dynamic information issue technology is one open, the expandable establishment dynamic web page's standard. no matter uses any foundation tool, the development personnel may use the web application which

27、 the jsp page founds may transplant, moves on the different web application server.jsp語法jsp文件(擴展名為.jsp)可以包含指令(或稱為指示語句)、class-wide變量和方法、 直接插入的java代碼(scriptlet)訪問javabean變量數(shù)據(jù)的html模型、變量數(shù)據(jù)的 java表達式的組合。1jsp指令使用jsp指令(在v%和內(nèi)的)來指定所使用的腳本語言、servlet實現(xiàn)的接口、 servlet擴展的類、servlet導入的軟件包。jsp指令的一般語法形式為:%指令名二” 值” 。其中有效的

28、指令名為:(1) language:文件中所使用的腳本語言。此時對于java程序設計語言來說,僅java為 有效值和缺省值。該指令作用于整個文件。當多次使用該指令時,只有第一次使用是有效的。 示例如下:v% language 二"java" %。(2) method:由嵌入的java代碼(scriptlet)生成的方法的名稱。生成的代碼會成為指 定方法名的主體。缺省的方法是serviceo當多次使用該指令時,只有第一次使用是有效的。 示例如下:v% method =hdopostu %。(3) import: servlet導入的java語言軟件包名或類名列表,該列表是用逗

29、號分隔的。 在jsp文件中,可以多次指定該指令來導入不同的軟件包。示例如下:v% import =,java.io.*java.util.hashtablen %°(4) content_type :生成的響應的mime類型。缺省值為text/html0當多次使用該指令 時,只有第一次使用是有效的.該指令可用以指定在其中對頁而進行編碼的字符集。示例 如下:v% content_type ="text/html; charset=gb2312" %。mplements:用于生成servlet實現(xiàn)的java語言接口列表,該列表是用逗號分隔的。 可以在一個jsp文件中多

30、次使用該命令,以實現(xiàn)不同的接口。示例如下:v% implements =mjavax.servlet.http.httpsessioncontexth %。(6) extends: servlet擴展的java語言類的名稱。該類必須是有效的,且不能是一個 servlet類。該指令作用于整個jsp文件。當多次使用該指令時,只有第一次使用是有效的。 示例如下:v% extends =mjavax.servlet.http.httpservlet" %。2. class-wide變量和方法使用 vscript和/script標記來說明servlet類的class-wide變量和 class

31、-wide方法。一般語法如下:script runat=server o/ class-wide變量和方法的代碼/script屬性runat=server是必需的,它表明該標記是用于服務器端處理的。指定class-wide變 量和方法的示例如下:script runat=server/ class-wide 變量init i = 0;string foo = nhellou;/ class-wide 方v去private void foo() /該方法的代碼</script>3. 訪問 javabeanjsp對javabean的支持使您能通過web站點重復使用組件o javabea

32、n可以是類文件 或串行化bean,也可由servlet動態(tài)生成。請使用<bean>標記來創(chuàng)建一個bean實例, 以使從jsp文件的任何地方都可對該實例進行訪問。標記<bean>的語法為:<bean name=hbean_nameu varname=nlocal_bean_namehtype =hclass_or_interface_namem introspect=myes|no"beanname=hser_filenamem create=hyes|nomscope=hrequest|session|userprofilen ><param

33、 property_name=,valueh></bean>其中的屬性及其含義如下:(1) name:用于在相應的范圍(由scope屬性指定)內(nèi)查找bean的名稱。例如,這可 能是用于存儲bean的會話(session)關(guān)鍵值。該值是分大小寫的。(2) varname:用于在jsp文件中的任何地方引用bean的名稱。該屬性是可選的。缺 省值為name屬性值。該值是分大小寫的。(3) type: bean的類文件名。該名稱用于以代碼說明bean實例。缺省值為object類 型。該值是分大小寫的。(4) introspect:當該值為真時,jsp處理器檢查將所有的請求屬性,并調(diào)用

34、與請求屬性 匹配的set屬性方法集(該屬性是在beaninfo中傳遞的)。該屈性的缺省值為是。(5) beanname: bean的.class文件名、bean軟件包名或包含bean的串行化文件(.scr 文件)的文件名。(該名稱是給bean實例程序的)。僅當bean不在指定的范圍中,且創(chuàng) 建屬性被設置成是吋,才使用該屬性。該值是分大小寫的。文件路徑必須在應用服務器的 java類路徑中指定,除非文件在applicationserver_rootservlets目錄下。(6) create:當該值為真時,如果處理器在指定的范圉內(nèi)沒有找到bean,則jsp將創(chuàng)建 一個bean實例。缺省值為真。(7

35、) scope: bean的生命期。該屬性是可選的,其缺省值為request o有效值為:request -由servlet將bean設置成請求的上下文,該servlet使用jspapi中描述的 api調(diào)用jsp文件。如果bean不是請求上下文的一部分,則將創(chuàng)建該bean,并將其存 儲在請求上下文中,除非創(chuàng)建屬性己設置為否。session -如果當前對話屮存在bean,則bean已被重用。如果不存在bean,且創(chuàng)建 屬性設置為是,則它已被創(chuàng)建并作為會話的一部分存儲起來。userprofile -由servlet請求對象檢索、造型成指定的類型,并進彳亍內(nèi)省的用戶簡要表 文件。(在 ibm web

36、shere 應用服務器中,缺省類型為 com.ibm.servlet.personalization.userprofile.userprofile)o(8) param:屬性和值配對的列表。屬性是在bean屮用內(nèi)省自動設置的。只在實例化 bean時,才對屬性進行設置。除了使用vpaam>屬性來設置bean屬性外,還可以使用其它三種方法:第一,在請 求包含bean的web頁面(jsp文件)的url時,指定查詢參數(shù)。必須將內(nèi)省屬性設置 成"是其示例如卜: bean屬性名將設置為joneso第二種方法,將屬性指定成由html <from>標記提交的 參數(shù)。必須將molh

37、od屬性設置成posto將action屬性設置成調(diào)用bean的jsp文件的 urlo必須將introspect屬性設置成“是”。其示例如下:<form action="/searchsite” method二"post"<input type=ntexth name=nsearch for: n>vinput type=hsubmith></form>第三中方法是使用jsp語法設置bean屬性。在指定了 vbean>標記后,就可以從jsp文件中的任何地方訪問beano這里有三種 訪

38、問bean屬性的方法:使用jspscriptlet使用jsp表達式、使用<insert>標記(如 同變量數(shù)據(jù)的html模板語法中所說明的)。請參閱jsp示例(displaydata.jsp文件)以 獲取三個訪問bean方法的每個方法示例。4. 直接插入的java代碼(scriptlet)可以在jsp文件的<%和%>標記間直接嵌入任何有效的java語言代碼。這樣嵌入 的代碼稱為scriptleto如果沒有指定method指令,則生成的代碼將成為service方法的主 體。用于servlet的scriptlet可以使用一個預定義的變量集,該變量集符合基本的servlet&g

39、t; 輸出和輸入類:(1) request:由 javax.servlet.http.httpservletrequest 定義的 servlet 請求類(2) responses:由 javax.servlet.http.httpservletrequest 定義的 servlet 響應類(3) out: rfl java.io.printwriter定義的輸岀轉(zhuǎn)錄程序類(4) in:由java.io.bufferedreader定義的輸入閱讀程序類其示例如下:<%foo = request.getparameterc'name");out.println(foo);

40、%>5. 變量數(shù)據(jù)的html模板語法當頁面被返回給瀏覽器時,應用服務器html模板語法使您能將變量字段放在html 頁面上,并使servlet和javabean可利用數(shù)據(jù)庫的值動態(tài)地替換變量。該功能是jsp的 一個ibm擴展,它使引用變量數(shù)據(jù)變得十分容易。該語法只能用于jsp文件屮。html模 板語法包括:基本html模板語法;替代html模板語法;<repeat> 標記。這些標記通過html編寫工具被設計成傳遞交互操作的標記。每一個標記有一個相應 的結(jié)束標記。每一個標記是分大小寫的,它們的一些屬性也是分大小寫的。ibm websphere studio使開發(fā)jsp文件以包含

41、html模板語法變得更為容易。(1) 基本html模板語法<insert>標記是用于指定變量字段的基本標記。一般的語法為:<insert requestparm=pvalue requestattr=avalue bean=nameproperty=property_name(optional_index).subproperty _name(optio nal_index) default=value_when_null></insert>其中的屈性及其含義如下:requestparm:要在請求對象內(nèi)進行訪問的參數(shù)。該屬性是分大小寫的,并且不能與bean

42、和property屬性一起使用。requestattr:要在請求對象內(nèi)進行訪問的屬性。屬性應使用setattribute方法設置。該 屬性是分大小寫的,并且不能與bean和property屬性一起使用。bean:由<bean>標記在jsp文件屮說明的javabean名。請參閱訪問javabean以 獲得<bean>標記的解釋。該屬性的值是分大小寫的。當指定了 bean屬性,但未指定 property屬性吋,在替換中將使用完整的bean。例如,如果bean是類型string且未指 定屬性,則將替代string的值。property:訪問替換的bean的屬性。該屬性的值是分

43、大小寫的,并且是屈性的獨立場 所名。該屬性不能與requestparm屬性一起使用。default:當bean屬性值為空時,顯示可選的字符串。如果字符串包含多個字,則該 字符串必須包含在一對雙引號中(例如"helpdesk number")。該屬性的值是分大小寫的。 如果未指定值,則當屬性值為空時,用空字符串替代?;菊Z法的示例如下:<insert bean=userprofile property=username></insert><insert requestparm=company default="ibm corporati

44、on"x/insert><insert requestattr=ceo default="company ceo"></insert>vinsert bean二userprofile property=lastconnectiondate.monthx/insert>在大多數(shù)情況下,property屬性的值就是屬性名。但是,可以通過指定property屬性的 全格式來訪問屬性的某一屬性(子屬性)。這個全格式也提供選擇項給您來指定索引屬性的 一個索引。該可選的索引可以是一個常數(shù)(例如2)或如重復設置html標記屮描述的索 引。使用

45、屬性標記的全格式示例如下:<insert bean=staffquery property=address(currentaddresslndex)x/insert><insert bean=shoppingcart property=items(4).price></insert><insert bean=foobean property=foo(2).bat(3).boo.far></insert>(2) 替代html模板語法html標準不允許在html標記中嵌入html標記。因而,就無法在另一個html 標記中嵌入vinsert

46、標記。作為代替,請使用html模板替代語法。要使用替代語法:請使用<insert>和v/insert>來包含html標記,在該標記中指出替代內(nèi)容。指定bean和property屬性:要指定bean和屬性特性,請使用下列格式:$(bean=b property二p default二d),其中b、 p和d作為描述基本語法的值。要指定requestparm屬性,請使用下列格式:$(requestparm=r default=d),其中r和d作 為描述基本語法的值。要指定requestattr屬性,請使用下列格式:$(requestattr=r default=d),其屮i和d作 為

47、描述基本語法的值。替代html模板語法的示例如下:<insert><img src=$(bean=productads property=sale default=default.gif)></insert><insert><a href=" default=usa)&city$(requestparm=city default="research triangle park*1)&email=$(bean=userlnfo property=email)>show map of city</

48、a></insert>(3) <repeat>標記crepe at>標記的語法為:<repeat index=name start=starting_index end=ending_index></repeat>其中:index:是用于標識該重復數(shù)據(jù)塊的一個可選的名稱。該值是分大小寫的。start:是用于該重復數(shù)據(jù)塊的一個可選的開始索引值。缺省值為0。end:是用于該重復數(shù)據(jù)塊的一個可選的結(jié)束索引值。最大值是2,147,483,647。如果結(jié) 束屬性的值小于開始屬性的值,則忽略結(jié)束屬性。下面的示例1、2和3顯示了如何使用<re

49、peat>標記。如果所有的索引屬性擁有300 個或更少的元素,則這些示例將產(chǎn)生相同的輸出。如果擁有的元素多于300個,示例1和 示例2將顯示所有的元素,而示例3將只顯示前300個元素。示例1用缺省開始和結(jié)束 索引顯示了隱式索引:使用最小索引屬性數(shù)的bean限制了循環(huán)重復的次數(shù)。<table><repeat><tr><td><insert bean=servicelocationsquery property=city></insert></tr></td><tr><td>

50、;<insert bean=servicelocationsquery property=address></insert></tr></td><tr><td><insert bean=servicelocationsquery property=telephone></insert></tr></td></repeat></table>示例2顯示了索引、開始索引和結(jié)束索引:<table><repeat index=mylndex s

51、tart=0 end=2147483647><tr><tdxinsert bean=servicelocationsquery property=city(mylndex)></inserl></tr></td><tr><td><insert bean=servicelocationsquery property=address(mylndex)></insert></tr></td><tr><td><insert bean=s

52、ervicelocationsquery property=telephone(mylndex)x/insertx/tr></td></repeat></table>示例3用隱式開始索引顯示了顯式索引和結(jié)朿索引。雖然指定了索引屬性,仍可對索 引過的屈性城市進行隱式索引,因為不需要(i)o<table><repeat index=mylndex end=299><tr><td><insert bean=servicelocationsquery property=city></insert

53、></tr></td><tr><td><insert bean=servicelocationsquery property=address(mylndex)>v/insert>v/tr></td><tr><td><insert bean=servicelocationsquery property=telephone(mylndex)x/insertx/tr></td></repeat></table>可以嵌套<repeat&

54、gt;數(shù)據(jù)塊。獨立索引每個數(shù)據(jù)塊。該能力對交叉兩個bean上的交錯 屬性或含有子屬性的屬性非常有用。在示例中,將兩個<repeat>數(shù)據(jù)塊嵌套,用以顯示用 戶購物手推車上每一張壓縮光盤上的歌曲列表。<repeat index=cdindex><h 1>vinsert bean二shoppingcart property=cds.title></insert></h 1 ><table><repeat><tr><td><insert bean=shoppingcart prop

55、erty=cds(cdindex).playlist></insert></tdx/tr></table></repeat></repeat>6. 變量數(shù)據(jù)的java表達式當處理jsp文件時,要指定分解一個java語言表達式,請使用jsp表達式標記<%= 和>。該表達式被評估和轉(zhuǎn)換成一個字符串,并加以顯示。原語類型,如int和float都 自動轉(zhuǎn)換成字符串表示法。在該示例屮,foo是在vscript>中加以說明的class-wide變 量,示例請見class-wide變量和方法:vp>翻譯歡迎辭v%二 f

56、oo %>.</p>當獲得jsp文件時,文本為:翻譯歡迎辭hello。jsp grammarthe jsp document (expansion named .jsp) may contain the instruction (or is called instruction sentence), the class-wide variable and the method, the straight insertion java code (scriptlet), visits javabean, the variable data html model, the var

57、iable data java expression combinatio n.l. jsp instructionthe software package which uses the jsp instruction () to assign to use the script language which, servlet realize the connection which, servlet to expand the kind which, servlet induct. the jsp instruction general syntax form is: and effecti

58、ve instruction named:(1) language: in the document uses script language. this time regarding the java programming language, only java is the effective value and the default value. this instruction function in the entire document. when uses this instruction many times, only then the first use is effe

59、ctive the demonstration is as follows:.(2) method: method name which (scriptlet) produces by the inserting java code the production code will become assigns the side name in religion the main body. the default method is service. when uses this instruction many times, only then the first use is effec

60、tive. the dem on stration is as follows: (3) lmport:servlet inducts java the language software package name or the kind are tables, this tabulation is separates with the comma .in the jsp document, may assign this instruction to induct the different software package many times. the demonstration is as follows:.(4) content_type: production response mime type the default value is text/html. when uses this instruction many times, only then the first use is effective this instruction available assigns in carries on the code to the page the character

溫馨提示

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

評論

0/150

提交評論