ehcache

net.sf.ehcache.constructs.web
Class ResponseHeadersNotModifiableException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by net.sf.ehcache.CacheException
                  extended by net.sf.ehcache.constructs.web.ResponseHeadersNotModifiableException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AlreadyCommittedException

public class ResponseHeadersNotModifiableException
extends CacheException

The HttpServletResponse.setHeader(String, String) method sets a response header with the given name and value.

If the header had already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.

In some cases, the HttpServletResponse.setHeader(String, String) is ignored.

  1. The ServletResponse.isCommitted().
  2. The RequestDispatcher.include(javax.servlet.ServletRequest, javax.servlet.ServletResponse) method was used to call the resource.
Ehcache-constructs may set the "Accept-Encoding" header to "gzip". If the response is committed before it has a change to do this, the client may receive gzipped content, but not the gzip header. This will cause an error in Internet Explorer. Mozilla will recognise the content and ungzip it.

If this situation occurs, rather than continue, this exception is thrown.

Version:
$Id: ResponseHeadersNotModifiableException.java 519 2007-07-27 07:11:45Z gregluck $
Author:
Greg Luck
See Also:
"SRV.8.3 in the Servlet 2.3 Specification", Serialized Form

Constructor Summary
ResponseHeadersNotModifiableException()
          Constructor for the exception
ResponseHeadersNotModifiableException(java.lang.String message)
          Constructs an exception with the message given
 
Method Summary
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResponseHeadersNotModifiableException

public ResponseHeadersNotModifiableException()
Constructor for the exception


ResponseHeadersNotModifiableException

public ResponseHeadersNotModifiableException(java.lang.String message)
Constructs an exception with the message given

Parameters:
message - the message

ehcache