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

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 3.1 Web提供的全局變量 Web集成模塊向模板提供web標準的變量,做如下說明 - request 中的所有attribute.在模板中可以直接通過attribute name 來引用,如在controller層 request.setAttribute("user",user),則在模板中可以直接用${user.name} . - session 提供了session會話,模板通過session["name"],或者session.name 引用session里的變量.注意,session并非serlvet里的標準session對象。參考servlet來獲取HTTPSession。 - request 標準的HTTPServletRequest,可以在模板里引用request屬性(getter),如${request.requestURL}。 - parameter 讀取用戶提交的參數。如${parameter.userId} (僅僅2.2.7以上版本支持) - ctxPath Web應用ContextPath - servlet 是WebVariable的實例,包含了HTTPSession,HTTPServletRequest,HTTPServletResponse.三個屬性,模板中可以通過request,response,session 來引用,如 ${servlet.request.requestURL}; - 所有的GroupTemplate的共享變量 - pageCtx是一個內置方法 ,僅僅在web開發中,用于設置一個變量,然后可以在頁面渲染過程中,調用此api獲取,如pageCtx("title","用戶添加頁面"),在其后任何地方,可以pageCtx("title") 獲取該變量。(僅僅2.2.7以上版本支持) 你可以在模板任何地方訪問這些變量 如果你需要擴展更多屬性,你也可以配置beetl.properties配置文件的WEBAPP_EXT屬性,實現WebRenderExt接口,在渲染模板之前增加自己的擴展,如: ```properties RESOURCE.root=/WEB-INF/views WEBAPP_EXT = com.park.oss.util.GlobalExt ``` ```java public class GlobalExt implements WebRenderExt{ static long version = System.currentTimeMillis(); @Override public void modify(Template template, GroupTemplate arg1, HttpServletRequest arg2, HttpServletResponse arg3) { //js,css 的版本編號 template.binding("sysVersion",version); } } ``` 這樣,每次在模板里都可以訪問變量sysVersion了,不需要在controller里設置,或者通過servlet filter來設置 對于Web框架,你可以利用Filter等機制設置模板需要的公共變量,是個更值得推薦的辦法
                  <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>

                              哎呀哎呀视频在线观看