zk 获取session,request,servletContext,response

(参考:http://www.dotblogs.com.tw/rockywang/archive/2010/01/13/12995.aspx)

session = Executions.getCurrent().getDesktop().getSession();或

HttpSession session = (HttpSession) Executions.getCurrent().getDesktop().getSession();

 

ServletContext sc =

(ServletContext) Sessions.getCurrent().getWebApp().getNativeContext();

 

HttpServletRequest request =

(HttpServletRequest) Executions.getCurrent().getNativeRequest();

 

HttpServletResponse response = (HttpServletResponse)Executions.getCurrent().getNativeResponse();

你可能感兴趣的:(servletContext)