<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ## 4.2 Spring 相關函數 Spring函數并沒有內置,需要注冊,如下 ```xml <bean name="beetlGroupUtilConfiguration" class="org.beetl.ext.spring.BeetlGroupUtilConfiguration" init-method="init"> <property name="functions"> <map> <!-- 定義SpEL方法 --> <entry key="spel"> <bean class="org.beetl.ext.spring.SpELFunction"/> </entry> </map> </property> <property name="functionPackages"> <map> <entry key="sputil"> <bean class="org.beetl.ext.spring.UtilsFunctionPackage"/> </entry> </map> </property> </bean> ``` spel(spelString, rootObject) SpEL方法傳入一個Spring SpEL表達式以獲取表達式結果,方法建議以函數的方式定義在BeetlGroupUtilConfiguration的functions中 spelString: SpEL表達式字符串,必傳(否則返回null) rootObject: 作為spel的根對象(對應#root),可以是一個Map或Bean對象,默認取空Map。由于Beetl運行上下文無法直接獲取模版局部變量的變量名,建議局部變量采用自定義Map的方式傳入 - 列表篩選(以自定義Map為根對象傳入局部變量) ```javascript <% var intArray = [12, 1, 2, 3]; %> ${spel('#root.intArray.?[#this>10]', {intArray: intArray})} ``` - 以Bean對象為根對象 ```javascript <% var now = date(); %> ${spel('#root.year + 1900', now)} ``` - 直接new對象 ```javascript ${spel('(new java.util.Date()).year + 1900')} ``` - 直接引用Spring Bean ```javascript ${spel('@testBean')} ``` - 默認變量 - \#root 表示SpEL的根對象, 由spel函數第二參數傳入,默認是一個空map - \#context 表示Beetl執行上下文 - \#global 表示Beetl的共享變量Map,由于Beetl上下文無法獲取臨時變量名,臨時變量建議使用根對象的方式傳入 - \#ctxPath 表示Servlet Context Path(由Beetl WebRender提供) - \#servlet 可以從中獲取到Servlet request,response,session原生實例(由Beetl WebRender提供) - \#parameter 表示請求參數Map(由Beetl WebRender提供) - \#request 表示請求對象(由Beetl WebRender提供) - \#session 表示會話域屬性Map(由Beetl WebRender提供) sputil 提供了spring內置的一些功能,如 ```java // 測試source中是否包含了candidates的某個成員(相當于交集非空) sputil.containsAny(Collection<?> source, Collection<?> candidates) // 返回在source集合總第一個也屬于candidates集的元素 sputil.findFirstMatch(Collection<?> source, Collection<?> candidates) // 測試指定文本是否匹配指定的Ant表達式(\*表達式), 多個表達式只要一個匹配即可 sputil.antMatch(String input, String... patterns) // 返回指定路徑表示的文件的擴展名(不帶點.) sputil.fileExtension(String path) // 忽略大小寫的endsWith sputil.endsWithIgnoreCase(String input, String suffix) // 忽略大小寫的startsWith sputil.startsWithIgnoreCase(String input, String prefix) // 測試輸入值是否為空白, null視為空白, 無視字符串中的空白字符 sputil.isBlank(String input) // 首字母大寫轉換 sputil.capitalize(String input) // 首字母小寫轉換 sputil.uncapitalize(String input) // 在集合或數組元素之間拼接指定分隔符返回字符串 // null表示空集, 其他類型表示單元素集合 sputil.join(Object collection, String delim) // 同上, 只是會在最后結果前后加上前綴和后綴 // 注意這個函數名叫做joinEx sputil.joinEx(Object collection, String delim, String prefix, String suffix) // 對文本進行html轉義 sputil.html(String input) // 對文本進行javascript轉義 sputil.javaScript(String input) ```
                  <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>

                              哎呀哎呀视频在线观看