/*
* Perform an operation after restore view.
*/
.addRule()
.when(Path.matches("/empty.xhtml").and(DispatchType.isRequest()))
.perform(PhaseOperation.enqueue(new Operation() {
@Override
public void perform(Rewrite event, EvaluationContext context)
{
if (PhaseId.RESTORE_VIEW.equals(FacesContext.getCurrentInstance().getCurrentPhaseId()))
SendStatus.code(203).perform(event, context);
else
SendStatus.code(503).perform(event, context);
}
}).after(PhaseId.RESTORE_VIEW))
/*
* Perform before Render Response
*/
.addRule()
.when(Path.matches("/render_response").and(DispatchType.isRequest()))
.perform(Forward.to("/empty.xhtml").and(PhaseOperation.enqueue(new Operation() {
@Override
public void perform(Rewrite event, EvaluationContext context)
{
if (PhaseId.RENDER_RESPONSE.equals(FacesContext.getCurrentInstance().getCurrentPhaseId()))
SendStatus.code(204).perform(event, context);