HttpSession1 [Spring] getSession(), getSession(true), getSession(false) 차이점 HttpSession session = request.getSession();HttpSession session = request.getSession(true);HttpSession session = request.getSession(false); getSession(true) -> 세션이 이미 있는지 확인을함, 이미 있다면 그 세션을 반환시키고 없으면 새로운 세션을 생성getSession(false) -> 세션이 있다면 그 세션을 리턴하지만, 세션이 존재하지 않는다면 null을 리턴한다 . getSession(true)에서는 기존의 세션이든 새로운 세션이든 무조건 세션을 받아옴getSession(false)에서는 세션이 있는 경우에만 세션을 리턴하므로 반드시 null체크를 해야함 HttpSession .. Spring 2018. 6. 15. 이전 1 다음