接口 LastModified
- 所有已知实现类:
MultiActionController
public interface LastModified
Supports last-modified HTTP requests to facilitate content caching. Same contract as for the Servlet API'sgetLastModified
method.Delegated to by a
HandlerAdapter.getLastModified(javax.servlet.http.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 theWebRequest.checkNotModified(long)
method, allowing for last-modified checking within the main handler method.- 作者:
- Rod Johnson, Juergen Hoeller
- 另请参阅:
HttpServlet.getLastModified(javax.servlet.http.HttpServletRequest)
,Controller
,SimpleControllerHandlerAdapter
,HttpRequestHandler
,HttpRequestHandlerAdapter
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 long
getLastModified(HttpServletRequest request)
Same contract as for HttpServlet'sgetLastModified
method.
方法详细资料
getLastModified
long getLastModified(HttpServletRequest request)
Same contract as for HttpServlet'sgetLastModified
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
- 另请参阅:
HandlerAdapter.getLastModified(javax.servlet.http.HttpServletRequest, java.lang.Object)
,HttpServlet.getLastModified(javax.servlet.http.HttpServletRequest)