[OmniFaces utilities] The
setResponseStatus()
method sets the HTTP response status code. You can use the constant field values of HttpServletResponse
for this. For example, Faces.setResponseStatus(HttpServletResponse.SC_BAD_REQUEST)
.Method:
See also: Faces#getContext()
Usage:import org.omnifaces.util.Faces;
...
// use HttpServletResponse
constants field values
Faces.setResponseStatus(HttpServletResponse.SC_NOT_IMPLEMENTED);
// or simply
uses the integers codes - http://www.w3.org/Protocols/HTTP/HTRESP.html
Faces.setResponseStatus(501);
Niciun comentariu :
Trimiteți un comentariu