请求会话与PageContext会话之间的差异

问题描述 投票:-1回答:1

有区别吗?

PageContext pageContext = (PageContext) getJspContext();
HttpSession session = pageContext.getSession();

=通过PageContext的会话

PageContext pageContext = (PageContext) getJspContext();
HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
HttpSession session = request.getSession();

=通过请求进行会话

session java-ee pagecontext
1个回答
0
投票
这两个会话对象之间的

否,没有区别PageContext提供促进从JSP页面访问HTTP和与会话相关的对象的方法,包括a mechanism to manage session usage by the page

© www.soinside.com 2019 - 2024. All rights reserved.