| java.lang.Object com.google.gwt.user.server.rpc.RPCServletUtils
RPCServletUtils | public class RPCServletUtils (Code) | | Utility class containing helper methods used by servlets that integrate with
the RPC system.
|
acceptsGzipEncoding | public static boolean acceptsGzipEncoding(HttpServletRequest request)(Code) | | Returns true if the
HttpServletRequest accepts Gzip
encoding. This is done by checking that the accept-encoding header
specifies gzip as a supported encoding.
Parameters: request - the request instance to test for gzip encoding acceptance true if the HttpServletRequest accepts Gzipencoding |
exceedsUncompressedContentLengthLimit | public static boolean exceedsUncompressedContentLengthLimit(String content)(Code) | | Returns true if the response content's estimated UTF-8 byte
length exceeds 256 bytes.
Parameters: content - the contents of the response true if the response content's estimated UTF-8 bytelength exceeds 256 bytes |
shouldGzipResponseContent | public static boolean shouldGzipResponseContent(HttpServletRequest request, String responseContent)(Code) | | Returns true if the request accepts gzip encoding and the
the response content's estimated UTF-8 byte length exceeds 256 bytes.
Parameters: request - the request associated with the response content Parameters: responseContent - a string that will be true if the request accepts gzip encoding and thethe response content's estimated UTF-8 byte length exceeds 256bytes |
writeResponse | public static void writeResponse(ServletContext servletContext, HttpServletResponse response, String responseContent, boolean gzipResponse) throws IOException(Code) | | Write the response content into the
HttpServletResponse . If
gzipResponse is true , the response content
will be gzipped prior to being written into the response.
Parameters: servletContext - servlet context for this response Parameters: response - response instance Parameters: responseContent - a string containing the response content Parameters: gzipResponse - if true the response content will begzip encoded before being written into the response throws: IOException - if reading, writing, or closing the response's outputstream fails |
writeResponseForUnexpectedFailure | public static void writeResponseForUnexpectedFailure(ServletContext servletContext, HttpServletResponse response, Throwable failure)(Code) | | 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.
Parameters: servletContext - Parameters: response - Parameters: failure - |
|
|