com.atlassian.plugin.servlet.util
Class LastModifiedHandler

java.lang.Object
  extended by com.atlassian.plugin.servlet.util.LastModifiedHandler
Direct Known Subclasses:
LastModifiedHandler

public class LastModifiedHandler
extends Object

This class manages the last modified date of a single HTTP resource.


Constructor Summary
LastModifiedHandler()
           
LastModifiedHandler(Date lastModifiedDate)
           
 
Method Summary
 boolean checkRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Check whether we need to generate a response for this request.
static boolean checkRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Date lastModifiedDate)
          This static method is used when the resource being served by the servlet keeps track of the last modified date, and so no state needs to be maintained by this handler.
 void modified()
          The content has changed, reset the modified date and the etag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LastModifiedHandler

public LastModifiedHandler()

LastModifiedHandler

public LastModifiedHandler(Date lastModifiedDate)
Method Detail

checkRequest

public boolean checkRequest(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response)
Check whether we need to generate a response for this request. Set the necessary headers on the response, and if we don't need to provide content, set the response status to 304. If this method returns true, the caller should not perform any more processing on the request.

Returns:
true if we don't need to provide any data to satisfy this request

modified

public void modified()
The content has changed, reset the modified date and the etag


checkRequest

public static boolean checkRequest(javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response,
                                   Date lastModifiedDate)
This static method is used when the resource being served by the servlet keeps track of the last modified date, and so no state needs to be maintained by this handler.



Copyright © 2011 Atlassian. All Rights Reserved.