private boolean shouldRedirectInSameState(RequestControlContext context) { if (redirect != null) { return redirect; } if (context.getExternalContext().isAjaxRequest() && context.getEmbeddedMode()) { return false; } return context.getRedirectInSameState(); }
private boolean shouldRedirect(RequestControlContext context) { if (redirect != null) { return redirect; } if (context.getExternalContext().isAjaxRequest() && context.getEmbeddedMode()) { return false; } return context.getRedirectOnPause(); }
private void refresh(View view, RequestControlContext context) { ExternalContext externalContext = context.getExternalContext(); if (externalContext.isResponseComplete()) { clearFlash(context); } else { render(context, view); } }
protected void doEnter(RequestControlContext context) throws FlowExecutionException { context.assignFlowExecutionKey(); ExternalContext externalContext = context.getExternalContext(); if (externalContext.isResponseComplete()) { if (!externalContext.isResponseCompleteFlowExecutionRedirect()) { clearFlash(context); } } else { if (shouldRedirect(context)) { context.getExternalContext().requestFlowExecutionRedirect(); if (popup) { context.getExternalContext().requestRedirectInPopup(); } } else { View view = viewFactory.getView(context); context.setCurrentView(view); render(context, view); } } }
private void render(RequestControlContext context, View view) throws ViewRenderingException { if (logger.isDebugEnabled()) { logger.debug("Rendering + " + view); logger.debug(" Flash scope = " + context.getFlashScope()); logger.debug(" Messages = " + context.getMessageContext()); } context.viewRendering(view); renderActionList.execute(context); try { view.render(); } catch (IOException e) { throw new ViewRenderingException(getOwner().getId(), getId(), view, e); } clearFlash(context); context.getExternalContext().recordResponseComplete(); context.viewRendered(view); }
/** * Specialization of State's <code>doEnter</code> template method that executes behavior specific to this state type * in polymorphic fashion. * <p> * This implementation pops the top (active) flow session off the execution stack, ending it, and resumes control in * the parent flow (if necessary). If the ended session is the root flow, a final response is rendered. * @param context the control context for the currently executing flow, used by this state to manipulate the flow * execution * @throws FlowExecutionException if an exception occurs in this state */ protected void doEnter(final RequestControlContext context) throws FlowExecutionException { FlowSession activeSession = context.getFlowExecutionContext().getActiveSession(); if (activeSession.isRoot()) { // entire flow execution is ending; issue the final response if (finalResponseAction != null && !context.getExternalContext().isResponseComplete()) { ActionExecutor.execute(finalResponseAction, context); context.getExternalContext().recordResponseComplete(); } context.endActiveFlowSession(getId(), createSessionOutput(context)); } else { // there is a parent flow that will resume (this flow is a subflow) LocalAttributeMap<Object> sessionOutput = createSessionOutput(context); context.endActiveFlowSession(getId(), sessionOutput); } }
boolean stateExited = handleEvent(view, context); if (!stateExited) { ExternalContext externalContext = context.getExternalContext(); if (externalContext.isResponseComplete()) { if (externalContext.isResponseCompleteFlowExecutionRedirect()) {
protected void doEnter(RequestControlContext context) throws FlowExecutionException { context.assignFlowExecutionKey(); if (context.getExternalContext().isResponseAllowed()) { if (shouldRedirect(context)) { context.getExternalContext().requestFlowExecutionRedirect(); if (popup) { context.getExternalContext().requestRedirectInPopup(); } } else { View view = viewFactory.getView(context); render(context, view); } } }
private void refresh(View view, RequestControlContext context) { ExternalContext externalContext = context.getExternalContext(); if (externalContext.isResponseComplete()) { clearFlash(context); } else { render(context, view); } }
private boolean shouldRedirect(RequestControlContext context) { if (redirect != null) { return redirect; } if (context.getExternalContext().isAjaxRequest() && context.getEmbeddedMode()) { return false; } return context.getRedirectOnPause(); }
private boolean shouldRedirectInSameState(RequestControlContext context) { if (redirect != null) { return redirect; } if (context.getExternalContext().isAjaxRequest() && context.getEmbeddedMode()) { return false; } return context.getRedirectInSameState(); }
protected void doEnter(RequestControlContext context) throws FlowExecutionException { context.assignFlowExecutionKey(); ExternalContext externalContext = context.getExternalContext(); if (externalContext.isResponseComplete()) { if (!externalContext.isResponseCompleteFlowExecutionRedirect()) { clearFlash(context); } } else { if (shouldRedirect(context)) { context.getExternalContext().requestFlowExecutionRedirect(); if (popup) { context.getExternalContext().requestRedirectInPopup(); } } else { View view = viewFactory.getView(context); context.setCurrentView(view); render(context, view); } } }
public void resume(RequestControlContext context) { restoreVariables(context); View view = viewFactory.getView(context); view.processUserEvent(); if (view.hasFlowEvent()) { Event event = view.getFlowEvent(); if (logger.isDebugEnabled()) { logger.debug("Event '" + event.getId() + "' returned from view " + view); } context.getRequestScope().put("webflow.originatingViewState", this); boolean stateExited = context.handleEvent(event); if (!stateExited && context.getExternalContext().isResponseAllowed()) { if (context.getExternalContext().isAjaxRequest()) { render(context, view); } else { context.getExternalContext().requestFlowExecutionRedirect(); } } } else { if (context.getExternalContext().isResponseAllowed()) { render(context, view); } } }
private void render(RequestControlContext context, View view) throws ViewRenderingException { if (logger.isDebugEnabled()) { logger.debug("Rendering + " + view); logger.debug(" Flash scope = " + context.getFlashScope()); logger.debug(" Messages = " + context.getMessageContext()); } context.viewRendering(view); renderActionList.execute(context); try { view.render(); } catch (IOException e) { throw new ViewRenderingException(getOwner().getId(), getId(), view, e); } clearFlash(context); context.getExternalContext().recordResponseComplete(); context.viewRendered(view); }
private void render(RequestControlContext context, View view) throws ViewRenderingException { if (logger.isDebugEnabled()) { logger.debug("Rendering + " + view); logger.debug(" Flash scope = " + context.getFlashScope()); logger.debug(" Messages = " + context.getMessageContext()); } context.viewRendering(view); renderActionList.execute(context); try { view.render(); } catch (IOException e) { throw new ViewRenderingException(getOwner().getId(), getId(), view, e); } context.getFlashScope().clear(); context.getMessageContext().clearMessages(); context.getExternalContext().recordResponseComplete(); context.viewRendered(view); }
/** * Specialization of State's <code>doEnter</code> template method that executes behavior specific to this state type * in polymorphic fashion. * <p> * This implementation pops the top (active) flow session off the execution stack, ending it, and resumes control in * the parent flow (if necessary). If the ended session is the root flow, a final response is rendered. * @param context the control context for the currently executing flow, used by this state to manipulate the flow * execution * @throws FlowExecutionException if an exception occurs in this state */ protected void doEnter(final RequestControlContext context) throws FlowExecutionException { FlowSession activeSession = context.getFlowExecutionContext().getActiveSession(); if (activeSession.isRoot()) { // entire flow execution is ending; issue the final response if (finalResponseAction != null && !context.getExternalContext().isResponseComplete()) { ActionExecutor.execute(finalResponseAction, context); context.getExternalContext().recordResponseComplete(); } context.endActiveFlowSession(getId(), createSessionOutput(context)); } else { // there is a parent flow that will resume (this flow is a subflow) LocalAttributeMap<Object> sessionOutput = createSessionOutput(context); context.endActiveFlowSession(getId(), sessionOutput); } }
/** * Specialization of State's <code>doEnter</code> template method that executes behavior specific to this state * type in polymorphic fashion. * <p> * This implementation pops the top (active) flow session off the execution stack, ending it, and resumes control in * the parent flow (if necessary). If the ended session is the root flow, a final response is rendered. * @param context the control context for the currently executing flow, used by this state to manipulate the flow * execution * @throws FlowExecutionException if an exception occurs in this state */ protected void doEnter(final RequestControlContext context) throws FlowExecutionException { FlowSession activeSession = context.getFlowExecutionContext().getActiveSession(); if (activeSession.isRoot()) { // entire flow execution is ending; issue the final response if (finalResponseAction != null && context.getExternalContext().isResponseAllowed()) { ActionExecutor.execute(finalResponseAction, context); context.getExternalContext().recordResponseComplete(); } context.endActiveFlowSession(getId(), createSessionOutput(context)); } else { // there is a parent flow that will resume (this flow is a subflow) LocalAttributeMap sessionOutput = createSessionOutput(context); context.endActiveFlowSession(getId(), sessionOutput); } }
boolean stateExited = handleEvent(view, context); if (!stateExited) { ExternalContext externalContext = context.getExternalContext(); if (externalContext.isResponseComplete()) { if (externalContext.isResponseCompleteFlowExecutionRedirect()) {