개발자의 끄적끄적

[java/spring] 자바 세션의 전체 데이터 출력하기 본문

개발/java & jsp

[java/spring] 자바 세션의 전체 데이터 출력하기

효벨 2021. 2. 7. 01:00
728x90
반응형

[java/spring] 자바 세션의 전체 데이터 출력하기

 

 

자바에서

 

현재 세션 데이터에 등록이 되어있는

 

전체 값을 출력하는 내용입니다!

 

Enumeration<?> attrName = session.getAttributeNames();
while (attrName.hasMoreElements()) {
    String attr = (String) attrName.nextElement();
    System.out.println(session.getAttribute(attr));
}

 

참고들 하세요!

반응형
Comments