httpresponse « Header « JSP-Servlet Q&A

1. Log only http servlet response headers

This is a question related to What if I only want to log the response headers, and not the entire body? Is there a different approach than described in ...

2. What's the proper way to set the Location header for an HTTP 201 response in a Java Servlet application

Consider the following code sending an HTTP 201 "Created" response to the client:

    String url = "/app/things?id=42"; // example

3. Java Servlet, How to add a response header before forwarding to another resource

I hava a servlet which handles some resources files, and I need to add a response header before I forward the request to the real jsp file.

response.setHeader("a", "b");
request.getRequestDispatcher("1.jsp").forward(request, response);
I need to ...