Interface IInterceptorResponse
- All Known Implementing Classes:
ServerServicesInterceptorResponseWrapper
public interface IInterceptorResponse
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a response header with the given name and value.void
Forces any content in the buffer to be written to the client.Returns the name of the character encodingReturns a String that indicates the content-type of the responseReturns the value of the specified request header as a StringGets the names of the headers of this response.getHeaders
(String name) Gets the values of the response header with the given name.jakarta.servlet.ServletOutputStream
Returns a ServletOutputStream suitable for writing binary data in the response.Returns a PrintWriter object that can send character text to the client.boolean
Returns a boolean indicating if the response has been committed.void
reset()
Clears any data that exists in the buffer as well as the status code and headers.void
sendError
(int sc) Sends an error response to the client using the specified status code and clears the buffer.void
Sends an error response to the client using the specified status code and clears the buffer.void
setCharacterEncoding
(String var1) Sets the character encoding of the response being sent to the client.void
Sets a response header with the given name and value.void
setStatus
(int sc) Sets the status code for this response.
-
Method Details
-
sendError
Sends an error response to the client using the specified status code and clears the buffer.- Parameters:
sc
- - the error status codemsg
- - the descriptive message- Throws:
IOException
- If an input or output exception occurs
-
sendError
Sends an error response to the client using the specified status code and clears the buffer.- Parameters:
sc
- - the error status code- Throws:
IOException
- If an input or output exception occurs
-
setHeader
Sets a response header with the given name and value. If the header had already been set, the new value overwrites the previous one.- Parameters:
name
- - the name of the headervalue
- - the header value
-
addHeader
Adds a response header with the given name and value.- Parameters:
name
- - the name of the headervalue
- - the additional header value
-
setStatus
Sets the status code for this response.- Parameters:
sc
- - the status code
-
getHeader
Returns the value of the specified request header as a String- Parameters:
name
- - the name of the response header whose value to return- Returns:
- the value of the response header with the given name, or null if no header with the given name has been set on this response
-
getHeaders
Gets the values of the response header with the given name.- Parameters:
name
- - the name of the response header whose values to return- Returns:
- a Collection of the values of the response header with the given name
-
getHeaderNames
Gets the names of the headers of this response.- Returns:
- a Collection of the names of the headers of this response
-
getOutputStream
Returns a ServletOutputStream suitable for writing binary data in the response.- Returns:
- a ServletOutputStream for writing binary data
- Throws:
IOException
- if the getWriter method has been called on this response
-
getWriter
Returns a PrintWriter object that can send character text to the client.- Returns:
- a PrintWriter object that can return character data to the client
- Throws:
IOException
- if an input or output exception occurred
-
flushBuffer
Forces any content in the buffer to be written to the client. A call to this method automatically commits the response, meaning the status code and headers will be written.- Throws:
IOException
-
reset
void reset()Clears any data that exists in the buffer as well as the status code and headers. -
setCharacterEncoding
Sets the character encoding of the response being sent to the client.- Parameters:
var1
- - a String specifying only the character
-
getCharacterEncoding
Returns the name of the character encoding -
isCommitted
boolean isCommitted()Returns a boolean indicating if the response has been committed. A committed response has already had its status code and headers written.- Returns:
- a boolean indicating if the response has been committed
-
getContentType
Returns a String that indicates the content-type of the response- Returns:
- String that indicates the content-type of the response
-