Package org.rribbit.processing
Class HttpRequestProcessorServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.rribbit.processing.HttpRequestProcessorServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
- Direct Known Subclasses:
SpringHttpRequestProcessorServlet
public abstract class HttpRequestProcessorServlet
extends jakarta.servlet.http.HttpServlet
This servlet processes requests that are dispatched by the
HttpRequestDispatcher
. It is not actually an implementation of RequestProcessor
, but uses a nested
LocalRequestProcessor
to do the actual processing. This is not a problem though, since an HttpRequestProcessorServlet
receives its requests via HTTP and not via
a Java interface. It accepts a ListenerObjectRetriever
and a ListenerObjectExecutor
, just like any other RequestProcessor
.
RRiBbit over HTTP uses POST exclusively. Other HTTP methods are NOT used.
This is an abstract class, because it needs a ListenerObjectRetriever
and a ListenerObjectExecutor
to do its work, just like any other RequestProcessor
.
These however, cannot be passed in the constructor, since passing objects in a constructor cannot be done with Java Servlets. The programmer must therefore subclass this class
and provide a ListenerObjectRetriever
and a ListenerObjectExecutor
via the abstract methods.
If you use Spring, then the SpringHttpRequestProcessorServlet
provides an implementation of this class that retrieves the ListenerObjectRetriever
and the
ListenerObjectExecutor
from the WebApplicationContext.
An HttpRequestProcessorServlet
can be mounted on an SSL or a non-SSL server, it should make no difference to its behaviour.- Author:
- G.J. Schouten
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ListenerObjectExecutor
Creates or fetches and returns aListenerObjectExecutor
that will be used to executeListenerObject
s.protected abstract ListenerObjectRetriever
Creates or fetches and returns aListenerObjectRetriever
that will be used to retrieveListenerObject
s.protected void
doPost
(jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse servletResponse) void
init()
When you override this, please make sure to call super.init().Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, init, service, service
Methods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
-
Field Details
-
requestProcessor
-
-
Constructor Details
-
HttpRequestProcessorServlet
public HttpRequestProcessorServlet()
-
-
Method Details
-
doPost
protected void doPost(jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse servletResponse) - Overrides:
doPost
in classjakarta.servlet.http.HttpServlet
-
init
public void init()When you override this, please make sure to call super.init().- Overrides:
init
in classjakarta.servlet.GenericServlet
-
createListenerObjectRetriever
Creates or fetches and returns aListenerObjectRetriever
that will be used to retrieveListenerObject
s.- Returns:
- The
ListenerObjectRetriever
that will be used to retrieveListenerObject
s
-
createListenerObjectExecutor
Creates or fetches and returns aListenerObjectExecutor
that will be used to executeListenerObject
s.- Returns:
- The
ListenerObjectExecutor
that will be used to executeListenerObject
s
-