有区别吗?
PageContext pageContext = (PageContext) getJspContext();
HttpSession session = pageContext.getSession();
=通过PageContext的会话
PageContext pageContext = (PageContext) getJspContext();
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
HttpSession session = request.getSession();
=通过请求进行会话
否,没有区别。 PageContext提供促进从JSP页面访问HTTP和与会话相关的对象的方法,包括a mechanism to manage session usage by the page