Class ServletHttpHandlerAdapter
java.lang.Object
org.springframework.http.server.reactive.ServletHttpHandlerAdapter
- All Implemented Interfaces:
- jakarta.servlet.Servlet
- Direct Known Subclasses:
- TomcatHttpHandlerAdapter
Adapt 
HttpHandler to an HttpServlet using Servlet Async support
and Servlet non-blocking I/O.- Since:
- 5.0
- Author:
- Arjen Poutsma, Rossen Stoyanchev
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected org.springframework.http.server.reactive.ServletServerHttpRequestcreateRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.AsyncContext context) protected org.springframework.http.server.reactive.ServletServerHttpResponsecreateResponse(jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.AsyncContext context, org.springframework.http.server.reactive.ServletServerHttpRequest request) voiddestroy()intReturn the configured input buffer size.@Nullable jakarta.servlet.ServletConfigReturn the Servlet path under which the Servlet is deployed by checking the Servlet registration frominit(ServletConfig).voidinit(jakarta.servlet.ServletConfig config) voidservice(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response) voidsetBufferSize(int bufferSize) Set the size of the input buffer used for reading in bytes.voidsetDataBufferFactory(DataBufferFactory dataBufferFactory) 
- 
Constructor Details- 
ServletHttpHandlerAdapter
 
- 
- 
Method Details- 
setBufferSizepublic void setBufferSize(int bufferSize) Set the size of the input buffer used for reading in bytes.By default this is set to 8192. 
- 
getBufferSizepublic int getBufferSize()Return the configured input buffer size.
- 
getServletPathReturn the Servlet path under which the Servlet is deployed by checking the Servlet registration frominit(ServletConfig).- Returns:
- the path, or an empty string if the Servlet is deployed without
a prefix (i.e. "/" or "/*"), or nullif this method is invoked before theinit(ServletConfig)Servlet container callback.
 
- 
setDataBufferFactory
- 
getDataBufferFactory
- 
initpublic void init(jakarta.servlet.ServletConfig config) - Specified by:
- initin interface- jakarta.servlet.Servlet
 
- 
servicepublic void service(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response) throws jakarta.servlet.ServletException, IOException - Specified by:
- servicein interface- jakarta.servlet.Servlet
- Throws:
- jakarta.servlet.ServletException
- IOException
 
- 
createRequestprotected org.springframework.http.server.reactive.ServletServerHttpRequest createRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.AsyncContext context) throws IOException, URISyntaxException - Throws:
- IOException
- URISyntaxException
 
- 
createResponseprotected org.springframework.http.server.reactive.ServletServerHttpResponse createResponse(jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.AsyncContext context, org.springframework.http.server.reactive.ServletServerHttpRequest request) throws IOException - Throws:
- IOException
 
- 
getServletInfo- Specified by:
- getServletInfoin interface- jakarta.servlet.Servlet
 
- 
getServletConfig- Specified by:
- getServletConfigin interface- jakarta.servlet.Servlet
 
- 
destroypublic void destroy()- Specified by:
- destroyin interface- jakarta.servlet.Servlet
 
 
-