<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 4.6 內置標簽函數 - include include一個模板,如 : ```javascript <%include("/header.html"){}%> ``` 如果想往子模板中傳入參數,則可以后面跟一個json變量 ```javascript <%include("/header.html",{'user':user,'id',user.id}){}%> ``` 這樣user,和id 可以在header.html被引用,并成為header.html的全局變量 > (beetl1.2 也叫includeFileTemplate ,2.0仍然支持,但不再文檔里體現了) - layout 提供一個布局功能,每個頁面總是由一定布局,如頁面頭,菜單,頁面腳,以及正文。 layout標簽允許為正文指定一個布局,如下使用方式 content.html內容如下: ```javascript <% //content.html內容如下: layout("/inc/layout.html"){%> this is 正文 .......... <%}%> ``` layout.html 是布局文件,內容如下 ```javascript <%include("/inc/header.html"){} %> this is content:${layoutContent} this is footer: ``` 運行content.html模板文件后,,正文文件的內容將被替換到layoutContent的地方,變成如下內容 ```javascript this is header this is content:this is 正文 ............ this is footer: ``` 如果想往layout頁面傳入參數,則傳入一個json變量,如下往layout.html頁面傳入一個用戶登錄時間 ```javascript <%layout("/inc/header.html",{'date':user.loginDate,'title':"內容頁面"}){%> this is 正文 .......... <%}%> ``` 如果layoutContent 命名有沖突,可以在layout第三個參數指定,如 ```javascript <%layout("/inc/header.html",{'date':user.loginDate,'title':"內容頁面"},"myLayoutContent"){%> this is 正文 .......... <%}%> ``` - cache 能Cache標簽的內容,并指定多長時間刷新,如 ```javascript <%:cache('key2',10,false){ %> 內容體 <%}%> ``` 需要指定三個參數 - 第一個是cache的Key值 - 第二個是緩存存在的時間,秒為單位 - 第三個表示是否強制刷新,false表示不,true表示強制刷新 Cache默認實現org.beetl.ext.tag.cache.SimpleCacheManager. 你可以設置你自己的Cache實現,通過調用CacheTag. cacheManager= new YourCacheImplementation(); 可以在程序里調用如下方法手工刪除Cache: ```java public void clearAll(); public void clearAll(String key); public void clearAll(String... keys); ``` - includeJSP,可以在模板里包括一個jsp文件,如: ```javascript <% includeJSP("/xxxx.jsp",{"key":"value"}){} %> ``` key value 都是字符串,將以parameter的形式提供給jsp,因此jsp可以通過request.getParameter("key")來獲取參數 主要注意的是,這個標簽并非內置,需要手工注冊一下 ```java groupTemplate.registerTag("incdlueJSP",org.beetl.ext.jsp.IncludeJSPTag.class); ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看