I am working in an Spring MVC project, where to get values from session we have used..
session = request.getSession(false);
Object obj = (Object) session.getAttribute("sessionVeriable");
Where as request
is HttpServletRequest
class object passed from controller.
My point is why HttpServletRequest
object is passed why not HttpSession
directly. Is there any difference getting session object from HttpServletRequest and directly from HttpSession?