posts - 48, comments - 13, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          Tapestry5ObtainingHttpServletRequest

          Tapestry encapsulates the HTTP servlet request, response and session, and you should not normally need to access them directly. However, sometimes it is necessary. For example, Acegi Security stores exception messages in the HttpSession.

          The underlying HTTP servlet mechanics are available via the [WWW] RequestGlobals service.

          Example

              @Inject
          private RequestGlobals requestGlobals;
          public void onActivate(Object context) {
          HttpSession session = requestGlobals.getHTTPServletRequest().getSession();
          ...
          }
          

          /!\ You need the servlet-api.jar in your classpath (dependency not included with tapestry quickstart).

          Alternatively, you can inject the HttpServletRequest directly (at least in 5.0.13):

              @Inject
          private HttpServletRequest _request;
          

          RequestGlobals is not accessible inside of AppModule.





          Copy From : http://wiki.apache.org/tapestry/Tapestry5ObtainingHttpServletRequest

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 吕梁市| 云南省| 泸溪县| 历史| 海林市| 聂荣县| 体育| 浦江县| 南康市| 广昌县| 广安市| 朝阳区| 山东省| 喀喇沁旗| 周口市| 尼木县| 平南县| 湘潭市| 芦溪县| 保德县| 拉孜县| 桂阳县| 察雅县| 平阴县| 杭锦后旗| 靖边县| 舞钢市| 公主岭市| 新巴尔虎左旗| 社旗县| 宕昌县| 株洲县| 建宁县| 伊吾县| 武宁县| 贵溪市| 大悟县| 汉寿县| 民县| 汶川县| 吴旗县|