How can you ensure that a response header is set only once in a servlet?
- addHeader()
- sendHeader()
- setHeader()
- writeHeader()
The setHeader() method is used to set a response header in a servlet, and it ensures that the specified header is set only once.
Loading...
Related Quiz
- What is the primary purpose of load balancing in web applications?
- What is the key difference between Stored XSS and Reflected XSS attacks?
- How do servlet filters complement the MVC architecture in web applications?
- If an SQL exception occurs in a method that performs multiple database updates, how should the exception be handled to maintain data integrity?
- In an MVC-based web application, where do servlets generally fit in?