Class RequestFactoryServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- com.google.web.bindery.requestfactory.server.RequestFactoryServlet
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class RequestFactoryServlet extends javax.servlet.http.HttpServlet
Handles GWT RequestFactory JSON requests.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RequestFactoryServlet()
Constructs a newRequestFactoryServlet
with 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 void
doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Processes a POST to the server.static javax.servlet.http.HttpServletRequest
getThreadLocalRequest()
Returns the thread-localHttpServletRequest
.static javax.servlet.http.HttpServletResponse
getThreadLocalResponse()
Returns the thread-localHttpServletResponse
.static javax.servlet.ServletContext
getThreadLocalServletContext()
Returns the thread-localServletContext
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Constructor Detail
-
RequestFactoryServlet
public RequestFactoryServlet()
Constructs a newRequestFactoryServlet
with aDefaultExceptionHandler
.
-
RequestFactoryServlet
public RequestFactoryServlet(ExceptionHandler exceptionHandler, ServiceLayerDecorator... serviceDecorators)
Use this constructor in subclasses to provide a customExceptionHandler
.- Parameters:
exceptionHandler
- anExceptionHandler
instanceserviceDecorators
- an array of ServiceLayerDecorators that change how the RequestFactory request processor interact with the domain objects
-
-
Method Detail
-
getThreadLocalRequest
public static javax.servlet.http.HttpServletRequest getThreadLocalRequest()
Returns the thread-localHttpServletRequest
.- Returns:
- an
HttpServletRequest
instance
-
getThreadLocalResponse
public static javax.servlet.http.HttpServletResponse getThreadLocalResponse()
Returns the thread-localHttpServletResponse
.- Returns:
- an
HttpServletResponse
instance
-
getThreadLocalServletContext
public static javax.servlet.ServletContext getThreadLocalServletContext()
Returns the thread-localServletContext
- Returns:
- the
ServletContext
associated with this servlet
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
Processes a POST to the server.- Overrides:
doPost
in classjavax.servlet.http.HttpServlet
- Parameters:
request
- anHttpServletRequest
instanceresponse
- anHttpServletResponse
instance- Throws:
java.io.IOException
- if an internal I/O error occursjavax.servlet.ServletException
- if an error occurs in the servlet
-
-