org.gwtwidgets.server.spring
Class ServletUtils

java.lang.Object
  extended by org.gwtwidgets.server.spring.ServletUtils

public class ServletUtils
extends java.lang.Object

Utility class that allows access to the invoking servlet request and response, which are stored in a thread local variable of the invoking thread.

Author:
George Georgovassilis, g.georgovassilis[at]gmail.com

Constructor Summary
ServletUtils()
           
 
Method Summary
static void disableResponseCaching(javax.servlet.http.HttpServletResponse response)
          Adjusts HTTP headers so that browsers won't cache response.
static javax.servlet.http.HttpServletRequest getRequest()
          Return the request which invokes the service.
static javax.servlet.http.HttpServletResponse getResponse()
          Return the response which accompanies the request.
static void setRequest(javax.servlet.http.HttpServletRequest request)
          Deprecated. Does not perform any operation
static void setResponse(javax.servlet.http.HttpServletResponse response)
          Assign the current servlet response to a thread local variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletUtils

public ServletUtils()
Method Detail

disableResponseCaching

public static void disableResponseCaching(javax.servlet.http.HttpServletResponse response)
Adjusts HTTP headers so that browsers won't cache response.

Parameters:
response - For more background see this.

getRequest

public static javax.servlet.http.HttpServletRequest getRequest()
Return the request which invokes the service. Valid only if used in the dispatching thread.

Returns:
the servlet request

getResponse

public static javax.servlet.http.HttpServletResponse getResponse()
Return the response which accompanies the request. Valid only if used in the dispatching thread.

Returns:
the servlet response

setRequest

public static void setRequest(javax.servlet.http.HttpServletRequest request)
Deprecated. Does not perform any operation

Assign the current servlet request to a thread local variable. Valid only if used inside the invoking thread scope.

Parameters:
request -

setResponse

public static void setResponse(javax.servlet.http.HttpServletResponse response)
Assign the current servlet response to a thread local variable. Valid only if used inside the invoking thread scope.

Parameters:
response -


Copyright © 2011. All Rights Reserved.