A servlet needs to send a file to the client with a specific filename. Which response header should be set and by which method?

  • Cache-Control, setHeader()
  • Content-Disposition, setHeader()
  • Content-Type, setContentType()
  • Location, sendRedirect()
To send a file with a specific filename, the Content-Disposition header should be set using the setHeader() method in the HttpServletResponse.
Add your answer
Loading...

Leave a comment

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