com.oreilly.servlet
类 CacheHttpServlet

java.lang.Object
  继承者 javax.servlet.GenericServlet
      继承者 javax.servlet.http.HttpServlet
          继承者 com.oreilly.servlet.CacheHttpServlet
所有已实现的接口:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public abstract class CacheHttpServlet
extends javax.servlet.http.HttpServlet

A superclass for HTTP servlets that wish to have their output cached and automatically resent as appropriate according to the servlet's getLastModified() method. To take advantage of this class, a servlet must:

This class uses the value returned by getLastModified() to manage an internal cache of the servlet's output. Before handling a request, this class checks the value of getLastModified(), and if the output cache is at least as current as the servlet's last modified time, the cached output is sent without calling the servlet's doGet() method.

In order to be safe, if this class detects that the servlet's query string, extra path info, or servlet path has changed, the cache is invalidated and recreated. However, this class does not invalidate the cache based on differing request headers or cookies; for servlets that vary their output based on these values (i.e. a session tracking servlet) this class should probably not be used.

No caching is performed for POST requests.

CacheHttpServletResponse and CacheServletOutputStream are helper classes to this class and should not be used directly.

This class has been built against Servlet API 2.2. Using it with previous Servlet API versions should work; using it with future API versions likely won't work.

版本:
0.93, 2004/06/25, added setCharacterEncoding() for servlets 2.4, 0.92, 2000/03/16, added synchronization blocks to make thread safe, 0.91, 1999/12/28, made support classes package protected, 0.90, 1999/12/19
作者:
Jason Hunter, Copyright © 1999
另请参见:
序列化表格

构造方法摘要
CacheHttpServlet()
           
 
方法摘要
protected  void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
           
 
从类 javax.servlet.http.HttpServlet 继承的方法
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
从类 javax.servlet.GenericServlet 继承的方法
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

CacheHttpServlet

public CacheHttpServlet()
方法详细信息

service

protected void service(javax.servlet.http.HttpServletRequest req,
                       javax.servlet.http.HttpServletResponse res)
                throws javax.servlet.ServletException,
                       IOException
覆盖:
javax.servlet.http.HttpServlet 中的 service
抛出:
javax.servlet.ServletException
IOException


Copyright © 2013. All Rights Reserved.