jsp 元素 | 語法 | 解釋 |
jsp expression | <%= 表達(dá)式 %> | expression 用于計(jì)算并用于輸出。 <jsp:expression>表達(dá)式</jsp:expression>,可使用的預(yù)定義的變量有request, response, out, session, application, config, and pagecontext(在sriptlets中也可使用)。 |
jsp scriptlet | <% 代碼 %> | 插入用于服務(wù)的代碼。 <jsp:scriptlet>代碼</jsp:scriptlet> |
jsp declaration | <!% 代碼 %> | 屬于servlet部分的代碼但并不是服務(wù)方法。 <jsp:declaration>代碼</jsp:declaration> |
jsp page directive | <%@ page att=”val” %> | 指向servlet引擎的路徑。 <jsp:directive.page att="val">. 以下是其合法的屬性(缺省值加粗): import="package.class" contenttype="mime-type" isthreadsafe="true|false" session="true|false" buffer="sizekb|none" autoflush="true|false" extends="package.class" info="message" errorpage="url" iserrorpage="true|false" language="java" |
jsp include directive | <%@ include file =”url” %> | 當(dāng)jsp page被翻譯成servlet 時(shí)將被包含進(jìn)去的本地系統(tǒng)上的文件。 <jsp:directive.include file=”url”> 這個(gè)url必須是相對(duì)的。當(dāng)頁面被請(qǐng)求時(shí)才用 “jsp:include action”調(diào)入。 |
jsp 注釋 | <%-- 注釋--%> | 當(dāng)jsp 轉(zhuǎn)換為servlet 時(shí)將被忽略。 <-- 注釋 --> |
the jsp:include action | <jsp:include page=”relative url” flush=”true”/> | 在頁面被請(qǐng)求(requested)時(shí)調(diào)入文件。 如果您想要在頁面被轉(zhuǎn)化(translated)時(shí)將文件包含進(jìn)來,則,請(qǐng)使用上面所提到的directive來代替。警告:在一些服務(wù)器上(servers),被包含的文件只能是html或jsp,一般以文件的后綴名來判定。 |
the jsp:usebean action | <jsp:usebean att=val*/>或<jsp:usebean att=val*> ….. </jsp:usebean> | 尋找或生成一個(gè)java bean. 可能的屬性是: id="name" scope="page|request|session|application" class="package.class" type="package.class" beanname="package.class" |
the jsp:setproperty action | <jsp:setproperty att=val*/> | 設(shè)置bean的屬性,通過明確的指定或使用request得到的參數(shù)。 合法的屬性: name="beanname" property="propertyname|*" param="parametername" value="val” |
the jsp:getproperty action | <jsp:getproperty name=”propertyname” value=”val”/> | 檢索并輸出bean的屬性。 |
the jsp:forward action | <jsp:forward page=”relative url”/> | 向前請(qǐng)求(request)另一個(gè)頁面。 |
the jsp:plugin action | <jsp:plugin attribute=”value”*> </jsp:plugin> | 生成特定的瀏覽器的object 或embed標(biāo)簽,用來明確運(yùn)行applet所 使用的java插件(plugin)。 |
新聞熱點(diǎn)
疑難解答
圖片精選