-1

Is there a difference?

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

=session through PageContext

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

=session through request

Akash
  • 425
  • 2
  • 7
  • 21
Jartyyy
  • 13
  • 5
  • The Session provides a way to identification across more than one page request while PageContext is provisioned for the Request – Akash Jan 01 '20 at 13:53

1 Answers1

0

No, there is no difference between these two session objects. PageContext provides methods to facilitate access to HTTP and Session related objects from a JSP page, including a mechanism to manage session usage by the page

Leonardo Cruz
  • 1,189
  • 9
  • 16