/** * Builds the view if not already available. This is mostly required for ViewExpiredException's. * * @param context The {@link FacesContext}. * @param throwable The occurred {@link Throwable}. * @param rootCause The root cause. * @return The unwrapped {@link Throwable}. * @throws java.io.IOException If building the view fails. */ protected Throwable buildView(FacesContext context, Throwable throwable, Throwable rootCause) throws IOException { if (context.getViewRoot() == null) { ViewHandler viewHandler = context.getApplication().getViewHandler(); String viewId = viewHandler.deriveViewId(context, ComponentUtils.calculateViewId(context)); ViewDeclarationLanguage vdl = viewHandler.getViewDeclarationLanguage(context, viewId); UIViewRoot viewRoot = vdl.createView(context, viewId); context.setViewRoot(viewRoot); vdl.buildView(context, viewRoot); // Workaround for Mojarra // if UIViewRoot == null -> 'IllegalArgumentException' is throwed instead of 'ViewExpiredException' if (rootCause == null && throwable instanceof IllegalArgumentException) { rootCause = new javax.faces.application.ViewExpiredException(viewId); } } return rootCause; }
requestMap.put("currentViewId", vee.getViewId());
try { fc.getExternalContext().getFlash().put("expiredViewId", vee.getViewId());
public static void throwViewExpiredException(String viewId) { throw new ViewExpiredException( "The expected view was not returned for the view identifier: " + viewId, viewId); } }
viewId = ((ViewExpiredException) throwable).getViewId();
public static void throwViewExpiredException(String viewId) { throw new ViewExpiredException( "The expected view was not returned for the view identifier: " + viewId, viewId); } }
String viewId = vex.getViewId();
viewId = ((ViewExpiredException) throwable).getViewId();
viewId = ((ViewExpiredException) throwable).getViewId();
/** * Builds the view if not already available. This is mostly required for ViewExpiredException's. * * @param context The {@link FacesContext}. * @param throwable The occurred {@link Throwable}. * @param rootCause The root cause. * @return The unwrapped {@link Throwable}. * @throws java.io.IOException If building the view fails. */ protected Throwable buildView(FacesContext context, Throwable throwable, Throwable rootCause) throws IOException { if (context.getViewRoot() == null) { ViewHandler viewHandler = context.getApplication().getViewHandler(); String viewId = viewHandler.deriveViewId(context, ComponentUtils.calculateViewId(context)); ViewDeclarationLanguage vdl = viewHandler.getViewDeclarationLanguage(context, viewId); UIViewRoot viewRoot = vdl.createView(context, viewId); context.setViewRoot(viewRoot); vdl.buildView(context, viewRoot); // Workaround for Mojarra // if UIViewRoot == null -> 'IllegalArgumentException' is throwed instead of 'ViewExpiredException' if (rootCause == null && throwable instanceof IllegalArgumentException) { rootCause = new javax.faces.application.ViewExpiredException(viewId); } } return rootCause; }
if (viewRoot == null) throw new ViewExpiredException("The expected view was not returned " + "for the view identifier: " + viewId, viewId);
} else { Object[] params = {viewId}; throw new ViewExpiredException( MessageUtils.getExceptionMessageString( MessageUtils.RESTORE_VIEW_ERROR_MESSAGE_ID,
throw new ViewExpiredException( getExceptionMessageString(RESTORE_VIEW_ERROR_MESSAGE_ID, params), viewId);
if (viewRoot == null) { Object[] params = {viewId}; throw new ViewExpiredException( getExceptionMessageString(RESTORE_VIEW_ERROR_MESSAGE_ID, params), viewId);
throw new ViewExpiredException( getExceptionMessageString(RESTORE_VIEW_ERROR_MESSAGE_ID, params), viewId);
throw new ViewExpiredException( MessageUtils.getExceptionMessageString( MessageUtils.RESTORE_VIEW_ERROR_MESSAGE_ID,