Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.RequestContext


    }
    return super.isWriteStateAfterRenderViewRequired(facesContext);
  }

  public void saveState(FacesContext facesContext, Object state) {
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    requestContext.getViewScope().put(FlowResponseStateManager.FACES_VIEW_STATE, state);
  }
View Full Code Here


  }

  @Override
  public Collection<String> getRenderIds() {
    if (JsfUtils.isFlowRequest()) {
      RequestContext requestContext = RequestContextHolder.getRequestContext();
      String[] fragmentIds = (String[]) requestContext.getFlashScope().get(View.RENDER_FRAGMENTS_ATTRIBUTE);
      if (fragmentIds != null && fragmentIds.length > 0) {
        return new ArrayList<String>(Arrays.asList(fragmentIds));
      }
    }
    return getWrapped().getRenderIds();
View Full Code Here

   *
   * @param name The name of the bean to resolve.
   * @return The JSF Managed Bean instance if found.
   */
  private Object getJsfManagedBean(String name) {
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    Assert.notNull(requestContext, "RequestContext cannot be null. "
        + "This PropertyAccessor is only intended to be invoked from an active Flow Execution.");
    boolean releaseFacesContext = false;
    FacesContext facesContext = FacesContext.getCurrentInstance();
    if (facesContext == null) {
View Full Code Here

  @Override
  public Object getState(FacesContext facesContext, String viewId) {
    if (!JsfUtils.isFlowRequest()) {
      return super.getState(facesContext, viewId);
    }
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    Object state = requestContext.getViewScope().get(FACES_VIEW_STATE);
    if (state == null) {
      logger.debug("No matching view in view scope");
    }
    return state;
  }
View Full Code Here

    saveState(state);
    return getFlowExecutionKey();
  }

  private void saveState(Object state) {
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    requestContext.getViewScope().put(FACES_VIEW_STATE, state);
  }
View Full Code Here

    RequestContext requestContext = RequestContextHolder.getRequestContext();
    requestContext.getViewScope().put(FACES_VIEW_STATE, state);
  }

  private String getFlowExecutionKey() {
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    return requestContext.getFlowExecutionContext().getKey().toString();
  }
View Full Code Here

public class SecurityFlowExecutionListenerTests extends TestCase {

  public void testSessionCreatingNoSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    FlowDefinition definition = new Flow("flow");
    listener.sessionCreating(context, definition);
  }
View Full Code Here

    listener.sessionCreating(context, definition);
  }

  public void testSessionCreatingWithSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Flow flow = new Flow("flow");
    SecurityRule rule = getSecurityRuleAnyAuthorized();
    flow.getAttributes().put(SecurityRule.SECURITY_ATTRIBUTE_NAME, rule);
    configureSecurityContext();
    listener.sessionCreating(context, flow);
View Full Code Here

    listener.sessionCreating(context, flow);
  }

  public void testStateEnteringNoSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Flow flow = new Flow("flow");
    ViewState state = new ViewState(flow, "view", new StubViewFactory());
    listener.stateEntering(context, state);
  }
View Full Code Here

    listener.stateEntering(context, state);
  }

  public void testStateEnteringWithSecurity() {
    SecurityFlowExecutionListener listener = new SecurityFlowExecutionListener();
    RequestContext context = new MockRequestContext();
    Flow flow = new Flow("flow");
    ViewState state = new ViewState(flow, "view", new StubViewFactory());
    SecurityRule rule = getSecurityRuleAllAuthorized();
    state.getAttributes().put(SecurityRule.SECURITY_ATTRIBUTE_NAME, rule);
    configureSecurityContext();
View Full Code Here

TOP

Related Classes of org.springframework.webflow.execution.RequestContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.