Top Description Fields Constructors Methods
org.springframework.web.context.support

public Class HttpRequestHandlerServlet

extends HttpServlet
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.io.IOException, jakarta.servlet.ServletException, jakarta.servlet.http.HttpServlet, .HttpServletRequest, .HttpServletResponse, org.springframework.context.i18n.LocaleContextHolder, org.springframework.http.HttpHeaders, org.springframework.lang.Nullable, org.springframework.util.Assert, .StringUtils, org.springframework.web.HttpRequestHandler, .HttpRequestMethodNotSupportedException, org.springframework.web.context.WebApplicationContext

Simple HttpServlet that delegates to an HttpRequestHandler bean defined in Spring's root web application context. The target bean name must match the HttpRequestHandlerServlet servlet-name as defined in web.xml.
Author
Juergen Hoeller
Since
2.0
See Also
org.springframework.web.HttpRequestHandler, org.springframework.web.servlet.DispatcherServlet

Field Summary

Modifier and TypeField and Description
private HttpRequestHandler
Inherited from jakarta.servlet.http.HttpServlet:
LEGACY_DO_HEAD

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
init()

Overrides jakarta.servlet.GenericServlet.init.

A convenience method which can be overridden so that there's no need to call super.init(config).
protected void
service(HttpServletRequest
the HttpServletRequest object that contains the request the client made of the servlet
request
,
HttpServletResponse
the HttpServletResponse object that contains the response the servlet returns to the client
response
)

Overrides jakarta.servlet.http.HttpServlet.service.

Receives standard HTTP requests from the public service method and dispatches them to the doMethod methods defined in this class.
Inherited from jakarta.servlet.http.HttpServlet:
doDeletedoGetdoHeaddoOptionsdoPostdoPutdoTracegetLastModifiedinitservice

Field Detail

targetback to summary
private HttpRequestHandler target
Annotations
@Nullable

Constructor Detail

HttpRequestHandlerServletback to summary
public HttpRequestHandlerServlet()

Method Detail

initback to summary
public void init() throws ServletException

Overrides jakarta.servlet.GenericServlet.init.

Doc from jakarta.servlet.GenericServlet.init.

A convenience method which can be overridden so that there's no need to call super.init(config).

Instead of overriding init(ServletConfig), simply override this method and it will be called by GenericServlet.init(ServletConfig config). The ServletConfig object can still be retrieved via getServletConfig.

Annotations
@Override
Exceptions
ServletException:
if an exception occurs that interrupts the servlet's normal operation
serviceback to summary
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException

Overrides jakarta.servlet.http.HttpServlet.service.

Doc from jakarta.servlet.http.HttpServlet.service.

Receives standard HTTP requests from the public service method and dispatches them to the doMethod methods defined in this class. This method is an HTTP-specific version of the jakarta.servlet.Servlet#service method. There's no need to override this method.

Parameters
request:HttpServletRequest

the HttpServletRequest object that contains the request the client made of the servlet

response:HttpServletResponse

the HttpServletResponse object that contains the response the servlet returns to the client

Annotations
@Override
Exceptions
ServletException:
if the HTTP request cannot be handled
IOException:
if an input or output error occurs while the servlet is handling the HTTP request