国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

struts的bean標(biāo)簽庫

2019-11-17 06:17:26
字體:
供稿:網(wǎng)友


 

        struts的bean標(biāo)記庫是對jsp的標(biāo)準(zhǔn)標(biāo)記庫的增強(qiáng),除了提供基本的jsp:userBean、jsp:setPRoperty等標(biāo)記的基本功能,還支持對多種對象的操作,從多種對象生產(chǎn)javaBean,提供了更方便的讀、寫B(tài)ean的方法。

        以下是從其官方網(wǎng)站的User Guide摘抄的對其功能的描述,

   

IntrodUCe A String Constant - 從字符串常量創(chuàng)建bean

    <bean:define id="foo" value="This is a new String"/>
    <bean:define id="bar" value='<%= "Hello, " + user.getName() %>'/>
    <bean:define id="last" scope="session"
                 value='<%= request.getRequestURI() %>'/>


Copy An Existing Bean - 為已有的bean創(chuàng)建新的引用(type屬性聲明該引用的類型)

    <bean:define id="foo" name="bar"/>
    <bean:define id="baz" name="bop" type="com.mycompany.MyBopClass"/>


Copy An Existing Bean Property - 從已存在的bean的屬性創(chuàng)建bean。可以使用的bean的屬性有三種:simple, nested, or indexed。

    <bean:define id="foo" name="bar" property="baz" scope="request"     toScope="session"/>    <bean:define id="bop" name="user" property="role[3].name"/>
Other Struts Copying Tags
Copy A Cookie - 從cookie創(chuàng)建bean。假如指定的cookie不存在則會拋出運(yùn)行時異常 - 因此,常和 <logic:present cookie="xxx"> 標(biāo)簽一起使用來保證cookie的存在。 通過指定multiple屬性,可以從多個同名cookie創(chuàng)建一個包含多個cookie的數(shù)組。

    <bean:cookie id="foo" name="cookiename"/>
    <bean:cookie id="all" name="JSESSIONID" multiple="true"/>


Copy A Request Header - 從請求頭創(chuàng)建bean。 (其余說明同上)

    <bean:header id="agent" name="User-Agent"/>    <bean:header id="languages" name="Accept-Language" multiple="true"/>
Copy A Dynamically Created Response - You can generate an internal request to the application you are running, and turn the response data that is returned from that request into a bean (of type String). One possible use for this technique is to acquire dynamically created xml formatted data that will be stored in a bean and later manipulated (such as by applying an XSLT stylesheet). If the current request is part of a session, the generated request for the include will also include the session identifier (and thus be considered part of the same session).(由于學(xué)識有限,這段還不太理解,所以沒有翻譯

    <bean:include id="text" name="/generateXml?param1=a&param2=b"/>
Copy A JSP Implicitly Defined Object - 從JSP內(nèi)置對象建立bean。

    <bean:page id="app" property="application"/>    <bean:page id="sess" property="session"/>


上一篇:如何寫注釋

下一篇:JDBC接口技術(shù)

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 石河子市| 南宁市| 衢州市| 宁津县| 南华县| 烟台市| 大竹县| 佛教| 凉城县| 兴宁市| 黄陵县| 安龙县| 浏阳市| 四会市| 天祝| 新和县| 三门峡市| 溧阳市| 镇康县| 晴隆县| 靖西县| 图们市| 中西区| 望奎县| 万年县| 正阳县| 城口县| 潮州市| 浙江省| 都安| 怀柔区| 弥勒县| 桐乡市| 班戈县| 乌兰察布市| 莱西市| 县级市| 五家渠市| 精河县| 无锡市| 凌海市|