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
FieldsFields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ListenerObjectExecutorCreates or fetches and returns aListenerObjectExecutorthat will be used to executeListenerObjects.protected abstract ListenerObjectRetrieverCreates or fetches and returns aListenerObjectRetrieverthat will be used to retrieveListenerObjects.protected voiddoPost(jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse servletResponse) voidinit()When you override this, please make sure to call super.init().Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPatch, doPut, doTrace, getLastModified, init, isSensitiveHeader, service, serviceMethods 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:
doPostin classjakarta.servlet.http.HttpServlet
-
init
public void init()When you override this, please make sure to call super.init().- Overrides:
initin classjakarta.servlet.GenericServlet
-
createListenerObjectRetriever
Creates or fetches and returns aListenerObjectRetrieverthat will be used to retrieveListenerObjects.- Returns:
- The
ListenerObjectRetrieverthat will be used to retrieveListenerObjects
-
createListenerObjectExecutor
Creates or fetches and returns aListenerObjectExecutorthat will be used to executeListenerObjects.- Returns:
- The
ListenerObjectExecutorthat will be used to executeListenerObjects
-