跳转/转向:
渲染指定视图页面:
// dispatchView(fc, "passed-app-index.xhtml");
public static void dispatchView(FacesContext fc, String viewId) {
fc.getExternalContext().setResponseStatus(200);
//fc.getExternalContext().getRequestMap().put("msg", msg);
var vh = fc.getApplication().getViewHandler();
var view = vh.createView(fc, viewId); fc.setViewRoot(view);
try { vh.getViewDeclarationLanguage(fc, viewId).buildView(fc, view);
vh.renderView(fc, view);
} catch (IOException ex) { System.err.println(ex); }
fc.responseComplete();
} // https://rogerkeays.com/jsf-error-pages-that-actually-work