java.lang.Object | ||||
↳ | javax.servlet.GenericServlet | |||
↳ | javax.servlet.http.HttpServlet | |||
↳ | com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet | |||
↳ | com.google.gwt.user.server.rpc.RemoteServiceServlet |
Known Direct Subclasses |
The servlet base class for your RPC service implementations that automatically deserializes incoming requests from the client and serializes outgoing responses for client/server RPCs.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
The default constructor used by service implementations that
extend this class.
| |||||||||||
The wrapping constructor used by service implementations that are
separate from this class.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a
SerializationPolicy for a given module base URL and
serialization policy strong name. | |||||||||||
Process a call originating from the given request.
| |||||||||||
Standard HttpServlet method: handle the POST.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is called by
processCall(String) and will throw a
SecurityException if getPermutationStrongName() returns
null . | |||||||||||
Gets the
SerializationPolicy for given module base URL and strong
name if there is one. | |||||||||||
Override this method to examine the serialized response that will be
returned to the client.
| |||||||||||
Override this method to examine the serialized version of the request
payload before it is deserialized into objects.
| |||||||||||
Determines whether the response to a given servlet request should or should
not be GZIP compressed.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
| |||||||||||
From class
javax.servlet.http.HttpServlet
| |||||||||||
From class
javax.servlet.GenericServlet
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.google.gwt.user.server.rpc.SerializationPolicyProvider
| |||||||||||
From interface
javax.servlet.Servlet
| |||||||||||
From interface
javax.servlet.ServletConfig
|
The default constructor used by service implementations that extend this class. The servlet will delegate AJAX requests to the appropriate method in the subclass.
The wrapping constructor used by service implementations that are separate from this class. The servlet will delegate AJAX requests to the appropriate method in the given object.
Returns a SerializationPolicy
for a given module base URL and
serialization policy strong name.
moduleBaseURL | the URL for the module |
---|---|
strongName | strong name of the serialization policy for the specified module URL |
SerializationPolicy
for a given module base URL and RPC
strong name; must not return null
Process a call originating from the given request. Uses the
invokeAndEncodeResponse(Object, java.lang.reflect.Method, Object[])
method to do the actual work.
Subclasses may optionally override this method to handle the payload in any
way they desire (by routing the request to a framework component, for
instance). The HttpServletRequest and HttpServletResponse
can be accessed via the getThreadLocalRequest()
and
getThreadLocalResponse()
methods.
payload | the UTF-8 request payload |
---|
IncompatibleRemoteServiceException
SerializationException | if we cannot serialize the response |
---|---|
UnexpectedException | if the invocation throws a checked exception that is not declared in the service method's signature |
RuntimeException | if the service method throws an unchecked exception (the exception will be the one thrown by the service) |
Standard HttpServlet method: handle the POST. This doPost method swallows ALL exceptions, logs them in the ServletContext, and returns a GENERIC_FAILURE_MSG response with status code 500.
ServletException | |
SerializationException | |
IOException | |
ServletException |
This method is called by processCall(String)
and will throw a
SecurityException if getPermutationStrongName()
returns
null
. This method can be overridden to be a no-op if there are
clients that are not expected to provide the
{@value com.google.gwt.user.client.rpc.RpcRequestBuilder#STRONG_NAME_HEADER}
header.
SecurityException | if getPermutationStrongName() returns
null
|
---|
Gets the SerializationPolicy
for given module base URL and strong
name if there is one.
Override this method to provide a SerializationPolicy
using an
alternative approach.
request | the HTTP request being serviced |
---|---|
moduleBaseURL | as specified in the incoming payload |
strongName | a strong name that uniquely identifies a serialization policy file |
SerializationPolicy
for the given module base URL and
strong name, or null
if there is none
Override this method to examine the serialized response that will be returned to the client. The default implementation does nothing and need not be called by subclasses.
Override this method to examine the serialized version of the request payload before it is deserialized into objects. The default implementation does nothing and need not be called by subclasses.
Determines whether the response to a given servlet request should or should not be GZIP compressed. This method is only called in cases where the requester accepts GZIP encoding.
This implementation currently returns true
if the response
string's estimated byte length is longer than 256 bytes. Subclasses can
override this logic.
request | the request being served |
---|---|
response | the response that will be written into |
responsePayload | the payload that is about to be sent to the client |
true
if responsePayload should be GZIP compressed,
otherwise false
.