Module io.jstach.opt.spring.webmvc
Package io.jstach.opt.spring.webmvc
Class ServletJStachioHttpMessageConverter
java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<Object>
io.jstach.opt.spring.web.JStachioHttpMessageConverter
io.jstach.opt.spring.webmvc.ServletJStachioHttpMessageConverter
- All Implemented Interfaces:
HttpMessageConverter<Object>
A servlet server aware
JStachioHttpMessageConverter
that will leverage
ServletResponse.setBufferSize(int)
to reduce duplicate buffering.- Author:
- agentgt
-
Field Summary
Fields inherited from class io.jstach.opt.spring.web.JStachioHttpMessageConverter
bufferLimit, DEFAULT_BUFFER_LIMIT, DEFAULT_MEDIA_TYPE
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
-
Constructor Summary
ConstructorDescriptionServletJStachioHttpMessageConverter
(JStachio jstachio, MediaType mediaType, int bufferLimit) -
Method Summary
Modifier and TypeMethodDescriptionprotected Output.CloseableEncodedOutput<IOException>
createOutput
(jakarta.servlet.http.HttpServletResponse response) Create the output from a servlet response.protected Output.CloseableEncodedOutput<IOException>
createOutput
(HttpOutputMessage message) Create the buffered output to use when executing JStachio.Methods inherited from class io.jstach.opt.spring.web.JStachioHttpMessageConverter
canRead, readInternal, supports, writeInternal
Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
addDefaultHeaders, canRead, canWrite, canWrite, getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.http.converter.HttpMessageConverter
getSupportedMediaTypes
-
Constructor Details
-
ServletJStachioHttpMessageConverter
- Parameters:
jstachio
- not null.mediaType
- used for setContentTypebufferLimit
- limit used if the response is not aServletServerHttpResponse
.
-
-
Method Details
-
createOutput
Description copied from class:JStachioHttpMessageConverter
Create the buffered output to use when executing JStachio.- Overrides:
createOutput
in classJStachioHttpMessageConverter
- Parameters:
message
- response.- Returns:
- the output ready for writing to.
- See Also:
-
createOutput
protected Output.CloseableEncodedOutput<IOException> createOutput(jakarta.servlet.http.HttpServletResponse response) Create the output from a servlet response.- Parameters:
response
- servlet response- Returns:
- closeable output.
-