The getLastModified() method is used to return the time the HttpServletRequest object was last modified, in milliseconds since midnight January 1, 1970 GMT. This method returns a negative number if the time is unknown. This method will be overriden by those Servlets that support HTTP GET requests and can quickly determine their last modification time. This method allows the browser and proxy caches work more effectively, reducing the load on server and network resources. The following is the general form of the method:
protected long getLastModified(HttpServletRequest rq1)
Here, the parameter rq1 is the HttpServletRequest object that is sent to the servlet. This method returns a long integer specifying the time the HttpServletRequest object was last modified.
Responses to “What is the getLastModified() method?”