To set the content type of the response in a servlet, which method is commonly used?
- addType(String type)
- appendContentType(String type)
- setContentType(String type)
- writeType(String type)
The setContentType(String type) method is commonly used to set the content type of the response in a servlet.
Loading...
Related Quiz
- When a user logs out of a web application, what should be done with the authentication cookies?
- The __________ method in servlets is often used to dispatch requests to different handlers in an MVC framework.
- How do you set a response header to indicate the content should be downloaded as a file?
- Describe the steps for setting up a custom error page for a specific type of exception in a servlet application.
- Describe how you would configure a filter to initialize with predefined parameters.