jsp response 객체 메소드

1. response 객체 메소드

 메소드 설명
 addCookie(Cookie cookie)
 쿠키 데이터 기록
 addHeader(String name, String value)
 response 헤더 내용 기록
 containsHeader(String name)
 지정된 헤더에 name설정 여부 리턴
 sendError(int status-code)
 에러 response를 클라이언트로 전송
 sendRedirect(String location)
 현재 페이지를 다른 페이지로 이동
 setStatus(int status-code)
 HTTP response 상태 코드 설정
 setBufferSize(int size)  출력 버퍼 크기 설정
 setContentType(String type)  전달할 내용의 MIME 타입 설정
 setHeader(String name, String value)  지정된 이름과 같은 값을 response 헤더 설정
 flushBuffer()  버퍼의 내용을 클라이언트로 전송
 getBufferSize()  출력 버퍼크기 리턴
 encodeURL(String url)
 세션ID와 URL을 합해 전송 코드로 변환
 encodeRedirectURL(String url)
 encodeURL의 역할과 동일.
 sendRedirect에 세션ID를 넘길때 사용

2. response의 상태코드와 메시지

 필드 코드
메시지
 SC_OK  200  OK
 SC_MOVED_PERMANENTLY  301  Moved Permanently
 SC_MOVED_TEMPORARILY  302  Move Temporarily
 SC_UNAUTHORIZED  401  Unauthorized
 SC_FOBIDDEN  403  Forbidden
 SC_NOT_FOUND  404  Not Found
 SC_INTERNAL_SERVER_ERROR  500  Internal Server Error
 SC_SERVICE_UNAVAILABLE  503  Service Unavailable

저작자 표시 비영리 변경 금지
Tag //
|  1  | ...  86  |  87  |  88  |  89  |  90  |  91  |  92  |  93  |  94  | ...  108  |