HTTP header 에 대해서 알아봅시다.
- public String getHeader(String headerName)
HTTP 요청 헤더에 지정된 headerName의 값을 문자열로 리턴한다. HTTP 요청 레더에 headerName 헤더가
존재하지 않는 경우 null을 리턴한다.
(예) headerName 몇가지만 실행시켜 보면 다음과 같다.
request.getHeader("user-agent"); ← 요청 HTTP 헤더는 클라이언트 기본정보가 들어가 있다.
[출력]
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)
HTTP 요청 헤더에 지정된 headerName의 값을 문자열로 리턴한다. HTTP 요청 레더에 headerName 헤더가
존재하지 않는 경우 null을 리턴한다.
(예) headerName 몇가지만 실행시켜 보면 다음과 같다.
request.getHeader("user-agent"); ← 요청 HTTP 헤더는 클라이언트 기본정보가 들어가 있다.
[출력]
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)
request.getHeader("referer"); ← 이전 URL를 얻을 수 있다.
[출력]
http://www.tonkjsp.com/jsp/implicit_obj/requestTest.html
[출력]
http://www.tonkjsp.com/jsp/implicit_obj/requestTest.html
request.getHeader("cookie"); ← 쿠키 값을 가져 온다.
[출력]
JSESSIONID=2AF61AD955FB488B690A6B0DA6FCBF61
[출력]
JSESSIONID=2AF61AD955FB488B690A6B0DA6FCBF61
request.getHeader("connection"); ← 클라이언트와 서버의 연결 상태에 관한 정보 .
[출력]
Keep-Alive (유지하고 있으며 살아 있다는 의미 겠네요)
[출력]
Keep-Alive (유지하고 있으며 살아 있다는 의미 겠네요)
request.getHeader("accept-language"); ← 클라이언트에서 지금 사용하고 있는 언어
[출력]
KO (Korean , KO 한글이라는 의미 입니다.)
[출력]
KO (Korean , KO 한글이라는 의미 입니다.)
request.getHeader("accept-encoding"); ← 클라이언트의 인코딩에 관련된 정보
[출력]
gzip, deflate
[출력]
gzip, deflate
request.getHeader("accept"); ← 클라이언트가 받아 들일 수 있는 MIME 형식에 관련된 정보
[출력]
image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
출처 :::: 아주 정리 잘되어 있음~~~ servlet 할때 참고!!!
http://blog.naver.com/donoteat84?Redirect=Log&logNo=20071353111
[출력]
image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
출처 :::: 아주 정리 잘되어 있음~~~ servlet 할때 참고!!!
http://blog.naver.com/donoteat84?Redirect=Log&logNo=20071353111
'JSP' 카테고리의 다른 글
[JSP] jar 체크 (1) | 2011.02.22 |
---|---|
[JSP] Cookie & JSP (0) | 2010.02.10 |
[JSTL] JSTL 정리 잘 되어 있는 블로그 (0) | 2009.12.10 |
JSP -> JSTL 변경 (1) | 2009.11.17 |
JSTL tag library jsp (0) | 2009.11.17 |