luni, 6 aprilie 2015

[OmniFaces utilities (2.0)] Check if the response is already committed


[OmniFaces utilities] The isResponseCommitted() method returns whether the response is already committed. That is, when the response headers and a part of the response body has already been sent to the client. This is usually a point of no return and you can't change the response anymore.

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

import org.omnifaces.util.Faces;
...
boolean committed = Faces.isResponseCommitted();

Note You can use this method to prevent errors of type "Response Already Committed".

Niciun comentariu:

Trimiteți un comentariu