response.addHeader("X-Test-Header", "test");
response.addHeader("Location", "http://example.com");This will add a header with name "Location" and value "http://example.com" to the response. This header is used for HTTP redirects. The javax.servlet.http package library includes the HttpServletResponse class.