The Spring Framework

Interface LastModified

All Known Implementing Classes:

public interface LastModified

Supports last-modified HTTP requests to facilitate content caching. Same contract as for the Servlet API's getLastModified method.

Delegated to by a HandlerAdapter's getLastModified implementation. By default, any Controller or HttpRequestHandler within Spring's default framework can implement this interface to enable last-modified checking.

Rod Johnson, Juergen Hoeller
See Also:
HttpServlet.getLastModified(javax.servlet.http.HttpServletRequest), Controller, SimpleControllerHandlerAdapter, HttpRequestHandler, HttpRequestHandlerAdapter

Method Summary
 long getLastModified(HttpServletRequest request)
          Same contract as for HttpServlet's getLastModified method.

Method Detail


long getLastModified(HttpServletRequest request)
Same contract as for HttpServlet's getLastModified method. Invoked before request processing.

The return value will be sent to the HTTP client as Last-Modified header, and compared with If-Modified-Since headers that the client sends back. The content will only get regenerated if there has been a modification.

request - current HTTP request
the time the underlying resource was last modified, or -1 meaning that the content must always be regenerated
See Also:
HandlerAdapter.getLastModified(javax.servlet.http.HttpServletRequest, java.lang.Object), HttpServlet.getLastModified(javax.servlet.http.HttpServletRequest)

The Spring Framework

Copyright © 2002-2007 The Spring Framework.