The response header 'Content-Disposition' with value 'attachment; filename="file.txt"' is set using the __________ method.
- addHeader()
- sendRedirect()
- setContentType()
- setHeader()
The setHeader() method is used to set response headers, including the 'Content-Disposition' for file downloads.
Loading...
Related Quiz
- In JDBC, the __________ exception is thrown when there is a problem with the SQL syntax.
- What is the primary purpose of using filters in web applications?
- A servlet handling massive data queries is experiencing performance issues. What optimization technique should be prioritized?
- How does using the PreparedStatement in servlets improve performance?
- The __________ method in servlets is often used to dispatch requests to different handlers in an MVC framework.