public interface LastModified
getLastModified
method.
Delegated to by a HandlerAdapter.getLastModified(HttpServletRequest, java.lang.Object)
implementation. By default, any Controller or HttpRequestHandler within Spring's
default framework can implement this interface to enable last-modified checking.
Note: Alternative handler implementation approaches have different
last-modified handling styles. For example, Spring 2.5's annotated controller
approach (using @RequestMapping
) provides last-modified support
through the WebRequest.checkNotModified(long)
method, allowing for last-modified checking within the main handler method.
javax.servlet.http.HttpServlet#getLastModified
,
Controller
,
SimpleControllerHandlerAdapter
,
HttpRequestHandler
,
HttpRequestHandlerAdapter
Modifier and Type | Method and Description |
---|---|
long |
getLastModified(HttpServletRequest request)
Same contract as for HttpServlet's
getLastModified method. |
long getLastModified(HttpServletRequest request)
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 requestHandlerAdapter.getLastModified(HttpServletRequest, java.lang.Object)
,
javax.servlet.http.HttpServlet#getLastModified