View Javadoc

1   /**
2    *  Copyright 2003-2007 Greg Luck
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   */
16  
17  package net.sf.ehcache.constructs.web;
18  
19  import net.sf.ehcache.CacheException;
20  
21  /**
22   *
23   * The {@link javax.servlet.http.HttpServletResponse#setHeader(String, String)} method
24   * sets a response header with the given name and value.
25   * <p/>
26   * If the header had already been set, the new value overwrites the previous one.
27   * The containsHeader method can be  used to test for the presence of a header before setting its  value.
28   * <p/>
29   * In some cases, the {@link javax.servlet.http.HttpServletResponse#setHeader(String, String)} is ignored.
30   * <ol>
31   * <li>The {@link javax.servlet.ServletResponse#isCommitted()}.
32   * <li>The {@link javax.servlet.RequestDispatcher#include(javax.servlet.ServletRequest, javax.servlet.ServletResponse)}
33   * method was used to call the resource.
34   * </ol>
35   * Ehcache-constructs may set the "Accept-Encoding" header to "gzip". If the response is committed before
36   * it has a change to do this, the client may receive gzipped content, but not the gzip header. This
37   * will cause an error in Internet Explorer. Mozilla will recognise the content and ungzip it.
38   * <p/>
39   * If this situation occurs, rather than continue, this exception is thrown.
40   * @see "SRV.8.3 in the Servlet 2.3 Specification"
41   * @author Greg Luck
42   * @version $Id: ResponseHeadersNotModifiableException.java 512 2007-07-10 09:18:45Z gregluck $
43   */
44  public class ResponseHeadersNotModifiableException extends CacheException {
45  
46      /**
47       * Constructor for the exception
48       */
49      public ResponseHeadersNotModifiableException() {
50          super();
51      }
52  
53      /**
54       * Constructs an exception with the message given
55       * @param message the message
56       */
57      public ResponseHeadersNotModifiableException(String message) {
58          super(message);
59      }
60  }