Package com.spec.web.expresso.message
Interface Response
- All Known Implementing Classes:
HttpResponse
public interface Response
Modifies the response that will be send to the client.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCloses the output stream.Returns the output stream from response servlet.Resets the responseResets the body of the responsesetContentTypeHeader(String contentType) Sets the content type headervoidsetCookies(jakarta.servlet.http.Cookie cookie, jakarta.servlet.http.Cookie... moreCookies) Sets a cookie that will be sent to the client.Sends html responsesetResponseHeader(String name, String value) Sets the response headers.setStatusCode(Integer statusCode) Sets the status code of the response.writeResponse(String response) Sets the http response body
-
Method Details
-
writeResponse
-
setStatusCode
-
setResponseHeader
-
setContentTypeHeader
-
setHtml
-
resetResponse
Response resetResponse()Resets the response- Returns:
- returns the current class instance for method chaining.
-
resetResponseBody
Response resetResponseBody()Resets the body of the response- Returns:
- returns the current class instance for method chaining.
-
getOutputStream
Returns the output stream from response servlet.- Returns:
- OutputStream
- Throws:
IOException- IOException
-
_closeOutputStream
boolean _closeOutputStream()Closes the output stream. Returns true if successfull- Returns:
- Returns true if successfull.
-
setCookies
void setCookies(jakarta.servlet.http.Cookie cookie, jakarta.servlet.http.Cookie... moreCookies) Sets a cookie that will be sent to the client.- Parameters:
cookie- Cookie instancemoreCookies- More cookies :)
-