vineri, 3 aprilie 2015

[OmniFaces utilities (2.0)] Add a header with given name and value to the HTTP response


[OmniFaces utilities] The addResponseHeader() method add a header with given name and value to the HTTP response.

Method:
See also: Faces#getContext()
Usage:

import org.omnifaces.util.Faces;
...
// set 'Content-Type' response header
Faces.addResponseHeader("Content-Type", "text/html; charset=UTF-8");
// set 'Cache-Control' response header
Faces.addResponseHeader("Cache-Control", "no-cache, no-store");

Niciun comentariu:

Trimiteți un comentariu