Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- Linux_명령어정리
- jsp
- Spring_에러정리
- 인스턴스
- DML
- spring
- SQL
- Git_명령어정리
- github
- java
- Git_정리
- 자바스크립트
- Spring_오류정리
- 자바
- 인덱스
- asp.net
- 이클립스
- HTML
- workbench
- JavaScript
- git
- 배열
- CSS
- json
- MySQL
- 다이어그램
- vb.net
- Linux
- 아파치톰캣
- SQL_용어정리
Archives
- Today
- Total
데브마우스
[JSP:프로그래밍 코드] 세션의 모든 데이터를 출력하는 프로그래밍 코드 본문
세션에 이것저것 담아놓고 테스트를 할 때가 있습니다.
이럴 때 유용한 코드입니다.
getAttributeNames() 메서드로 세션의 모든 Key 값을 가져옵니다.
그리고 Key 값을 기반으로 모든 Value 값을 출력시키는 프로그래밍 코드입니다.
Enumeration<String> attributeNames = session.getAttributeNames();
while (attributeNames.hasMoreElements()) {
String attributeName = attributeNames.nextElement();
Object attributeValue = session.getAttribute(attributeName);
System.out.println(attributeName + " : " + attributeValue);
}