sâmbătă, 18 iulie 2015

[OmniFaces utilities 2.2] Refresh the current page by a GET request


[OmniFaces utilities] The refresh() method refreshes the current page by a GET request. This basically sends a temporary (302) redirect to current request URI, without query string. Whenever something fails at I/O level, the caller should preferably not catch it, but just redeclare it in the action method. The servlet container will handle it.

Method:
Usage:

<h:form>
 <h:commandButton value="Refresh" action="#{bean.refreshPage()}" />
</h:form>

public void refreshPage() throws IOException {       
 Faces.refresh();
}

Niciun comentariu:

Trimiteți un comentariu