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.StringBAD_REQUEST_PAGEstatic java.lang.StringBUFFER_SIZE_PROPERTYstatic java.lang.StringDEFAULT_FILE_PAGEstatic java.lang.StringFAVICONstatic java.lang.StringMETHOD_NOT_ALLOWED_PAGEstatic java.lang.StringNOT_FOUND_PAGE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAllowedMethod(HttpMethod httpMethod)OPTION Method으로 요청이 왔을 시 해당 URL로 사용할 수 있는 HttpMethod를 추가한다.voidaddCookies(Cookie cookie)쿠키 정보를 추가한다.voidallowedMethods()지원하는 method들을 응답한다.voidbadRequest()잘못된 요청에 대한 처리를 한다.voidexecute(java.lang.String pathOrJson, HttpStatus status)HTTP 응답 메시지를 만든다.voidfavicon()파비콘에 대한 요청을 처리 한다.java.lang.ObjectgetHeader(java.lang.String key)헤더 정보를 반환한다.java.util.Set<java.lang.String>getHeaderNames()모든 헤더의 이름을 반환한다.voidindexFile()루트 경로의 요청을 처리한다.voidmethodNotAllowed()요청한 URL이 일치하는 핸들러는 있지만 HTTP Method가 일치하지 않을 때에 대한 처리를 한다.voidnotFound()찾는 정적 자원이 존재하지 않을시 처리한다.voidsetContentMimeType(ContentType contentMimeType)응답할 미디어 타입을 설정한다.voidsetHeader(java.lang.String key, java.lang.String value)헤더 정보를 추가한다.voidstaticResources()정적 자원에 대한 처리를 한다.
-
-
-
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
-
-