Class SimpleServletHandlerAdapter

  • All Implemented Interfaces:
    HandlerAdapter

    public class SimpleServletHandlerAdapter
    extends Object
    implements HandlerAdapter
    Adapter to use the Servlet interface with the generic DispatcherServlet. Calls the Servlet's service method to handle a request.

    Last-modified checking is not explicitly supported: This is typically handled by the Servlet implementation itself (usually deriving from the HttpServlet base class).

    This adapter is not activated by default; it needs to be defined as a bean in the DispatcherServlet context. It will automatically apply to mapped handler beans that implement the Servlet interface then.

    Note that Servlet instances defined as bean will not receive initialization and destruction callbacks, unless a special post-processor such as SimpleServletPostProcessor is defined in the DispatcherServlet context.

    Alternatively, consider wrapping a Servlet with Spring's ServletWrappingController. This is particularly appropriate for existing Servlet classes, allowing to specify Servlet initialization parameters etc.

    Since:
    1.1.5
    Author:
    Juergen Hoeller
    See Also:
    Servlet, HttpServlet, SimpleServletPostProcessor, ServletWrappingController