What method would you use to set the expiration date of a servlet response as a specific date and time?

  • response.setDateHeader("Expires", System.currentTimeMillis() + 86400000);
  • response.setExpirationDate("2024-12-31T23:59:59");
  • response.setExpirationTime("2024-12-31T23:59:59");
  • response.setExpires("2024-12-31T23:59:59");
The response.setDateHeader("Expires", System.currentTimeMillis() + 86400000); method is used to set the expiration date of a servlet response to a specific date and time.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *