java.lang.Object | |
↳ | com.google.gwt.user.server.rpc.RPCServletUtils |
Utility class containing helper methods used by servlets that integrate with the RPC system.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns
true if the HttpServletRequest accepts Gzip
encoding. | |||||||||||
Returns
true if the response content's estimated UTF-8 byte
length exceeds 256 bytes. | |||||||||||
Returns true if the java.lang.reflect.Method Method definition on
the service is specified to throw the exception contained in the
InvocationTargetException or false otherwise.
| |||||||||||
Returns the content of an HttpServletRequest by decoding it using
expectedCharSet , or UTF-8 if
expectedCharSet is null. | |||||||||||
Returns the content of an HttpServletRequest, after verifying a
gwt/x-gwt-rpc; charset=utf-8 content type. | |||||||||||
This method is deprecated.
Use
readContent(HttpServletRequest, String, String) instead.
| |||||||||||
This method is deprecated.
Use
readContent(HttpServletRequest, String, String) instead.
| |||||||||||
Sets the correct header to indicate that a response is gzipped.
| |||||||||||
Returns
true if the request accepts gzip encoding and the the
response content's estimated UTF-8 byte length exceeds 256 bytes. | |||||||||||
Write the response content into the HttpServletResponse.
| |||||||||||
Called when the servlet itself has a problem, rather than the invoked
third-party method.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Returns true
if the HttpServletRequest accepts Gzip
encoding. This is done by checking that the accept-encoding header
specifies gzip as a supported encoding.
request | the request instance to test for gzip encoding acceptance |
---|
true
if the HttpServletRequest accepts Gzip
encoding
Returns true
if the response content's estimated UTF-8 byte
length exceeds 256 bytes.
content | the contents of the response |
---|
true
if the response content's estimated UTF-8 byte
length exceeds 256 bytes
Returns true if the java.lang.reflect.Method Method definition on the service is specified to throw the exception contained in the InvocationTargetException or false otherwise. NOTE we do not check that the type is serializable here. We assume that it must be otherwise the application would never have been allowed to run.
serviceIntfMethod | the method from the RPC request |
---|---|
cause | the exception that the method threw |
Returns the content of an HttpServletRequest by decoding it using
expectedCharSet
, or UTF-8
if
expectedCharSet
is null.
request | the servlet request whose content we want to read |
---|---|
expectedContentType | the expected content (i.e. 'type/subtype' only)
in the Content-Type request header, or null if no
validation is to be performed, and you are willing to allow for
some types of cross type security attacks |
expectedCharSet | the expected request charset, or null
if no charset validation is to be performed and UTF-8
should be assumed |
expectedCharSet
, or UTF-8
if
expectedCharSet
is null
IOException | if the request's input stream cannot be accessed, read from or closed |
---|---|
ServletException | if the request's content type does not
equal the supplied expectedContentType or
expectedCharSet
|
Returns the content of an HttpServletRequest, after verifying a
gwt/x-gwt-rpc; charset=utf-8
content type.
request | the servlet request whose content we want to read |
---|
UTF-8
IOException | if the request's input stream cannot be accessed, read from or closed |
---|---|
ServletException | if the request's content type is not
gwt/x-gwt-rpc; charset=utf-8 , ignoring case
|
This method is deprecated.
Use readContent(HttpServletRequest, String, String)
instead.
Returns the content of an HttpServletRequest by decoding it using the UTF-8 charset.
request | the servlet request whose content we want to read |
---|
IOException | if the requests input stream cannot be accessed, read from or closed |
---|---|
ServletException | if the content length of the request is not specified of if the request's content type is not 'text/x-gwt-rpc' and 'charset=utf-8' |
This method is deprecated.
Use readContent(HttpServletRequest, String, String)
instead.
Returns the content of an HttpServletRequest by decoding it using the UTF-8 charset.
request | the servlet request whose content we want to read |
---|---|
checkHeaders | Specify 'true' to check the Content-Type header to see that it matches the expected value 'text/x-gwt-rpc' and the content encoding is UTF-8. Disabling this check may allow some types of cross type security attacks. |
IOException | if the requests input stream cannot be accessed, read from or closed |
---|---|
ServletException | if the content length of the request is not specified of if the request's content type is not 'text/x-gwt-rpc' and 'charset=utf-8' |
Sets the correct header to indicate that a response is gzipped.
Returns true
if the request accepts gzip encoding and the the
response content's estimated UTF-8 byte length exceeds 256 bytes.
request | the request associated with the response content |
---|---|
responseContent | a string that will be |
true
if the request accepts gzip encoding and the the
response content's estimated UTF-8 byte length exceeds 256 bytes
Write the response content into the HttpServletResponse. If
gzipResponse
is true
, the response content will
be gzipped prior to being written into the response.
servletContext | servlet context for this response |
---|---|
response | response instance |
responseContent | a string containing the response content |
gzipResponse | if true the response content will be gzip
encoded before being written into the response |
IOException | if reading, writing, or closing the response's output stream fails |
---|
Called when the servlet itself has a problem, rather than the invoked third-party method. It writes a simple 500 message back to the client.