Class RequestFactoryServlet
- java.lang.Object
-
- jakarta.servlet.GenericServlet
-
- jakarta.servlet.http.HttpServlet
-
- com.google.web.bindery.requestfactory.server.jakarta.RequestFactoryServlet
-
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,java.io.Serializable
public class RequestFactoryServlet extends jakarta.servlet.http.HttpServletHandles GWT RequestFactory JSON requests.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RequestFactoryServlet()Constructs a newRequestFactoryServletwith aDefaultExceptionHandler.RequestFactoryServlet(ExceptionHandler exceptionHandler, ServiceLayerDecorator... serviceDecorators)Use this constructor in subclasses to provide a customExceptionHandler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)Processes a POST to the server.static jakarta.servlet.http.HttpServletRequestgetThreadLocalRequest()Returns the thread-localHttpServletRequest.static jakarta.servlet.http.HttpServletResponsegetThreadLocalResponse()Returns the thread-localHttpServletResponse.static jakarta.servlet.ServletContextgetThreadLocalServletContext()Returns the thread-localServletContext-
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Constructor Detail
-
RequestFactoryServlet
public RequestFactoryServlet()
Constructs a newRequestFactoryServletwith aDefaultExceptionHandler.
-
RequestFactoryServlet
public RequestFactoryServlet(ExceptionHandler exceptionHandler, ServiceLayerDecorator... serviceDecorators)
Use this constructor in subclasses to provide a customExceptionHandler.- Parameters:
exceptionHandler- anExceptionHandlerinstanceserviceDecorators- an array of ServiceLayerDecorators that change how the RequestFactory request processor interact with the domain objects
-
-
Method Detail
-
getThreadLocalRequest
public static jakarta.servlet.http.HttpServletRequest getThreadLocalRequest()
Returns the thread-localHttpServletRequest.- Returns:
- an
HttpServletRequestinstance
-
getThreadLocalResponse
public static jakarta.servlet.http.HttpServletResponse getThreadLocalResponse()
Returns the thread-localHttpServletResponse.- Returns:
- an
HttpServletResponseinstance
-
getThreadLocalServletContext
public static jakarta.servlet.ServletContext getThreadLocalServletContext()
Returns the thread-localServletContext- Returns:
- the
ServletContextassociated with this servlet
-
doPost
protected void doPost(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws java.io.IOException, jakarta.servlet.ServletExceptionProcesses a POST to the server.- Overrides:
doPostin classjakarta.servlet.http.HttpServlet- Parameters:
request- anHttpServletRequestinstanceresponse- anHttpServletResponseinstance- Throws:
java.io.IOException- if an internal I/O error occursjakarta.servlet.ServletException- if an error occurs in the servlet
-
-