Package org.sam.server.http.web.response
Interface Response
-
- All Known Implementing Classes:
HttpResponse
public interface Response
응답에 대한 가능을 정의 해놓은 인터페이스.- See Also:
HttpResponse
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BAD_REQUEST_PAGE
static java.lang.String
BUFFER_SIZE_PROPERTY
static java.lang.String
DEFAULT_FILE_PAGE
static java.lang.String
FAVICON
static java.lang.String
METHOD_NOT_ALLOWED_PAGE
static java.lang.String
NOT_FOUND_PAGE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addAllowedMethod(HttpMethod httpMethod)
OPTION Method으로 요청이 왔을 시 해당 URL로 사용할 수 있는 HttpMethod를 추가한다.void
addCookies(Cookie cookie)
쿠키 정보를 추가한다.void
allowedMethods()
지원하는 method들을 응답한다.void
badRequest()
잘못된 요청에 대한 처리를 한다.void
execute(java.lang.String pathOrJson, HttpStatus status)
HTTP 응답 메시지를 만든다.void
favicon()
파비콘에 대한 요청을 처리 한다.java.lang.Object
getHeader(java.lang.String key)
헤더 정보를 반환한다.java.util.Set<java.lang.String>
getHeaderNames()
모든 헤더의 이름을 반환한다.void
indexFile()
루트 경로의 요청을 처리한다.void
methodNotAllowed()
요청한 URL이 일치하는 핸들러는 있지만 HTTP Method가 일치하지 않을 때에 대한 처리를 한다.void
notFound()
찾는 정적 자원이 존재하지 않을시 처리한다.void
setContentMimeType(ContentType contentMimeType)
응답할 미디어 타입을 설정한다.void
setHeader(java.lang.String key, java.lang.String value)
헤더 정보를 추가한다.void
staticResources()
정적 자원에 대한 처리를 한다.
-
-
-
Field Detail
-
DEFAULT_FILE_PAGE
static final java.lang.String DEFAULT_FILE_PAGE
- See Also:
- Constant Field Values
-
BAD_REQUEST_PAGE
static final java.lang.String BAD_REQUEST_PAGE
- See Also:
- Constant Field Values
-
NOT_FOUND_PAGE
static final java.lang.String NOT_FOUND_PAGE
- See Also:
- Constant Field Values
-
FAVICON
static final java.lang.String FAVICON
- See Also:
- Constant Field Values
-
METHOD_NOT_ALLOWED_PAGE
static final java.lang.String METHOD_NOT_ALLOWED_PAGE
- See Also:
- Constant Field Values
-
BUFFER_SIZE_PROPERTY
static final java.lang.String BUFFER_SIZE_PROPERTY
-
-
Method Detail
-
execute
void execute(java.lang.String pathOrJson, HttpStatus status)
HTTP 응답 메시지를 만든다.- Parameters:
pathOrJson
- 파일 경로 or JSONstatus
- 응답 HttpStatus
-
favicon
void favicon()
파비콘에 대한 요청을 처리 한다.- See Also:
execute(String, HttpStatus)
-
indexFile
void indexFile()
루트 경로의 요청을 처리한다.- See Also:
execute(String, HttpStatus)
-
staticResources
void staticResources()
정적 자원에 대한 처리를 한다.- See Also:
execute(String, HttpStatus)
-
notFound
void notFound()
찾는 정적 자원이 존재하지 않을시 처리한다.- See Also:
execute(String, HttpStatus)
-
badRequest
void badRequest()
잘못된 요청에 대한 처리를 한다.- See Also:
execute(String, HttpStatus)
-
methodNotAllowed
void methodNotAllowed()
요청한 URL이 일치하는 핸들러는 있지만 HTTP Method가 일치하지 않을 때에 대한 처리를 한다.- See Also:
execute(String, HttpStatus)
-
allowedMethods
void allowedMethods()
지원하는 method들을 응답한다.- See Also:
execute(String, HttpStatus)
-
setHeader
void setHeader(java.lang.String key, java.lang.String value)
헤더 정보를 추가한다.- Parameters:
key
- 헤더명value
- 헤더값- See Also:
HttpHeader
-
setContentMimeType
void setContentMimeType(ContentType contentMimeType)
응답할 미디어 타입을 설정한다.- Parameters:
contentMimeType
- 미디어 타입- See Also:
ContentType
-
addAllowedMethod
void addAllowedMethod(HttpMethod httpMethod)
OPTION Method으로 요청이 왔을 시 해당 URL로 사용할 수 있는 HttpMethod를 추가한다.- Parameters:
httpMethod
- 추가할 HTTP Method- See Also:
HttpMethod
-
addCookies
void addCookies(Cookie cookie)
쿠키 정보를 추가한다.- Parameters:
cookie
- 추가할 쿠키- See Also:
Cookie
-
getHeader
java.lang.Object getHeader(java.lang.String key)
헤더 정보를 반환한다.- Parameters:
key
- 헤더명- Returns:
- 헤더
- See Also:
HttpHeader
-
getHeaderNames
java.util.Set<java.lang.String> getHeaderNames()
모든 헤더의 이름을 반환한다.- Returns:
- 헤더 이름 리스트
- See Also:
HttpHeader
-
-