httpresponse « Header « JSP-Servlet Q&A





1. Log only http servlet response headers    stackoverflow.com

This is a question related to http://stackoverflow.com/questions/3242236/capture-and-log-the-response-body. 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    stackoverflow.com

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

    String url = "/app/things?id=42"; // example
    response.setStatus(HttpServletResponse.SC_CREATED);
    response.setContentType("text/plain");
  ...

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

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 ...