Monday, 27 June 2016

How to set a HTTP response header ?


Methods of the HttpServletResponse interface
  • setHeader : sets a header with a given name and value
    If header name already exists, it will replace all the n existing values with 1 new value
  • addHeader : adds a header value to a given name
  • setIntHeader : sets a int type header
  • setDateHeader : sets a Date type header
  • addIntHeader : adds a int type header
  • addDateHeader : adds a Date type header

* Headers must be set before the response is committed.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.