Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.RequestContext


    putContextFactory(RequestContext.class, new RequestContextELContextFactory());
  }

  private static class RequestContextELContextFactory implements ELContextFactory {
    public ELContext getELContext(Object target) {
      RequestContext context = (RequestContext) target;
      List customResolvers = new ArrayList();
      customResolvers.add(new RequestContextELResolver(context));
      customResolvers.add(new FlowResourceELResolver(context));
      customResolvers.add(new ImplicitFlowVariableELResolver(context));
      customResolvers.add(new ScopeSearchingELResolver(context));
View Full Code Here


  public SpringBeanWebFlowVariableResolver(VariableResolver originalVariableResolver) {
    super(originalVariableResolver);
  }

  protected BeanFactory getBeanFactory(FacesContext facesContext) {
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    if (requestContext == null) {
      return EMPTY_BEAN_FACTORY;
    }
    BeanFactory beanFactory = requestContext.getActiveFlow().getApplicationContext();
    return beanFactory != null ? beanFactory : EMPTY_BEAN_FACTORY;
  }
View Full Code Here

  protected void restoreComponentState(FacesContext context, UIViewRoot viewRoot, String renderKitId) {
    if (!JsfUtils.isFlowRequest()) {
      super.restoreComponentState(context, viewRoot, renderKitId);
      return;
    }
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    SerializedView view = (SerializedView) requestContext.getViewScope().get(SERIALIZED_VIEW_STATE);
    viewRoot.processRestoreState(context, view.componentState);
    logger.debug("UIViewRoot component state restored");
  }
View Full Code Here

  protected UIViewRoot restoreTreeStructure(FacesContext context, String viewId, String renderKitId) {
    if (!JsfUtils.isFlowRequest()) {
      return super.restoreTreeStructure(context, viewId, renderKitId);
    }
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    SerializedView view = (SerializedView) requestContext.getViewScope().get(SERIALIZED_VIEW_STATE);
    if (view == null || !view.viewId.equals(viewId)) {
      logger.debug("No matching view in view scope");
      return null;
    }
    if (logger.isDebugEnabled()) {
View Full Code Here

      return null;
    }
    if (!JsfUtils.isFlowRequest()) {
      return delegate.saveView(context);
    }
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    if (logger.isDebugEnabled()) {
      logger.debug("Saving view root '" + context.getViewRoot().getViewId() + "' in view scope");
    }
    SerializedView view = new SerializedView(context.getViewRoot().getViewId(), getTreeStructureToSave(context),
        getComponentStateToSave(context));
    requestContext.getViewScope().put(SERIALIZED_VIEW_STATE, view);
    return view;
  }
View Full Code Here

    return null;
  }

  public boolean isReadOnly(ELContext context, Object base, Object property) {
    if (base == null) {
      RequestContext requestContext = RequestContextHolder.getRequestContext();
      if (requestContext.getExternalContext().getRequestMap().contains(property.toString())
          || requestContext.getExternalContext().getSessionMap().contains(property.toString())
          || requestContext.getExternalContext().getApplicationMap().contains(property.toString())) {
        context.setPropertyResolved(true);
      }
    }
    return false;
  }
View Full Code Here

  /**
   * Sets a bean value if a corresponding key is found in one of the ExternalContext scopes.
   */
  public void setValue(ELContext context, Object base, Object property, Object value) {
    if (base == null) {
      RequestContext requestContext = RequestContextHolder.getRequestContext();
      if (requestContext.getExternalContext().getRequestMap().contains(property.toString())) {
        context.setPropertyResolved(true);
        requestContext.getExternalContext().getRequestMap().put(property.toString(), value);
      } else if (requestContext.getExternalContext().getSessionMap().contains(property.toString())) {
        context.setPropertyResolved(true);
        requestContext.getExternalContext().getSessionMap().put(property.toString(), value);
      } else if (requestContext.getExternalContext().getApplicationMap().contains(property.toString())) {
        context.setPropertyResolved(true);
        requestContext.getExternalContext().getApplicationMap().put(property.toString(), value);
      }
    }
  }
View Full Code Here

   * This resolver is only meant to be called from the Flow Execution, thus it assumes that the FacesContext will not
   * be available and creates a temporary one on the fly.
   * @return The initialized FacesContext.
   */
  private FacesContext getFacesContext() {
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    Assert.notNull(requestContext, "RequestContext cannot be null - This resolver is only intended to be invoked "
        + "from an active Flow Execution.");
    FacesContext facesContext = FlowFacesContext.newInstance(requestContext, FlowLifecycle.newInstance());
    return facesContext;
  }
View Full Code Here

  public void setAjaxEnabled(Boolean ajaxEnabled) {
    this.ajaxEnabled = ajaxEnabled;
  }

  public boolean isImmediate() {
    RequestContext context = RequestContextHolder.getRequestContext();
    if (context != null && getActionExpression().isLiteralText()
        && context.getCurrentState() instanceof TransitionableState) {
      TransitionDefinition transition = context
          .getMatchingTransition(getActionExpression().getExpressionString());
      if (transition != null && transition.getAttributes().contains("bind")) {
        return Boolean.FALSE.equals(transition.getAttributes().getBoolean("bind"));
      }
    }
View Full Code Here

    if (!JsfUtils.isFlowRequest()) {
      return delegateResolver.resolveUrl(path);
    }

    try {
      RequestContext context = RequestContextHolder.getRequestContext();
      ApplicationContext flowContext = context.getActiveFlow().getApplicationContext();
      if (flowContext == null) {
        throw new IllegalStateException("A Flow ApplicationContext is required to resolve Flow View Resources");
      }

      ApplicationContext appContext = flowContext.getParent();
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.