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

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


          網站導航:
           
          主站蜘蛛池模板: 古田县| 汾西县| 封丘县| 原阳县| 昌平区| 东乡| 湖州市| 宜都市| 霸州市| 盐津县| 绥宁县| 沙坪坝区| 濉溪县| 淮滨县| 衡南县| 安陆市| 辉县市| 突泉县| 新民市| 珲春市| 无棣县| 固镇县| 凤城市| 司法| 林周县| 治县。| 鄂托克前旗| 灌阳县| 项城市| 疏附县| 武宁县| 瓦房店市| 且末县| 武山县| 临澧县| 玉门市| 启东市| 丁青县| 桃园市| 沙湾县| 深州市|