Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.RequestContext



  protected String[] getRenderFragments(Map<String, Object> model, HttpServletRequest request,
      HttpServletResponse response) {

    RequestContext context = RequestContextHolder.getRequestContext();
    if (context == null) {
      return super.getRenderFragments(model, request, response);
    }

    String[] fragments = (String[]) context.getFlashScope().get(View.RENDER_FRAGMENTS_ATTRIBUTE);
    if (fragments == null) {
      return super.getRenderFragments(model, request, response);
    }

    return fragments;
View Full Code Here



  protected String[] getRenderFragments(Map<String, Object> model, HttpServletRequest request,
      HttpServletResponse response) {

    RequestContext context = RequestContextHolder.getRequestContext();
    if (context == null) {
      return super.getRenderFragments(model, request, response);
    }

    String[] fragments = (String[]) context.getFlashScope().get(View.RENDER_FRAGMENTS_ATTRIBUTE);
    if (fragments == null) {
      return super.getRenderFragments(model, request, response);
    }

    return fragments;
View Full Code Here

    logger.warn("Destruction callback for '" + name + "' was not registered. Spring Web Flow does not "
        + "support destruction of scoped beans.");
  }

  protected RequestContext getRequiredRequestContext() {
    RequestContext context = RequestContextHolder.getRequestContext();
    if (context == null) {
      throw new IllegalStateException(
          "No request context bound to this thread; to access flow-scoped beans you must be running in a flow execution request");
    }
    return context;
View Full Code Here

      this.delegate = delegate;
    }

    public Object getProperty(Map context, Object target, Object name) throws OgnlException {
      String property = name.toString();
      RequestContext requestContext = (RequestContext) target;
      if (property.equals("flowRequestContext")) {
        return requestContext;
      }
      if (property.equals("currentUser")) {
        return requestContext.getExternalContext().getCurrentUser();
      }
      if (property.equals("resourceBundle")) {
        return requestContext.getActiveFlow().getApplicationContext();
      }
      if (requestContext.getRequestScope().contains(property)) {
        return requestContext.getRequestScope().get(property);
      } else if (requestContext.getFlashScope().contains(property)) {
        return requestContext.getFlashScope().get(property);
      } else if (requestContext.inViewState() && requestContext.getViewScope().contains(property)) {
        return requestContext.getViewScope().get(property);
      } else if (requestContext.getFlowScope().contains(property)) {
        return requestContext.getFlowScope().get(property);
      } else if (requestContext.getConversationScope().contains(property)) {
        return requestContext.getConversationScope().get(property);
      }
      BeanFactory bf = getBeanFactory(requestContext);
      if (bf.containsBean(property)) {
        return bf.getBean(property);
      }
View Full Code Here

      return delegate.getProperty(context, target, name);
    }

    public void setProperty(Map context, Object target, Object name, Object value) throws OgnlException {
      String property = name.toString();
      RequestContext requestContext = (RequestContext) target;
      if (property.equals("flowRequestContext")) {
        throw new OgnlException("The 'flowRequestContext' variable is not writeable");
      }
      if (property.equals("currentUser")) {
        throw new OgnlException("The 'currentUser' variable is not writeable");
      }
      if (property.equals("resourceBundle")) {
        throw new OgnlException("The 'resourceBundle' variable is not writeable");
      }
      if (requestContext.getRequestScope().contains(property)) {
        requestContext.getRequestScope().put(property, value);
      } else if (requestContext.getFlashScope().contains(property)) {
        requestContext.getFlashScope().put(property, value);
      } else if (requestContext.inViewState() && requestContext.getViewScope().contains(property)) {
        requestContext.getViewScope().put(property, value);
      } else if (requestContext.getFlowScope().contains(property)) {
        requestContext.getFlowScope().put(property, value);
      } else if (requestContext.getConversationScope().contains(property)) {
        requestContext.getConversationScope().put(property, value);
      } else {
        delegate.setProperty(context, target, name, value);
      }
    }
View Full Code Here

   * Configures EL context instances for evaluating against a Web Flow request context.
   * @author Keith Donald
   */
  private static class RequestContextELContextFactory implements ELContextFactory {
    public ELContext getELContext(Object target) {
      RequestContext context = (RequestContext) target;
      List<ELResolver> customResolvers = new ArrayList<ELResolver>();
      customResolvers.add(new RequestContextELResolver(context));
      customResolvers.add(new FlowResourceELResolver(context));
      customResolvers.add(new ImplicitFlowVariableELResolver(context));
      customResolvers.add(new ScopeSearchingELResolver(context));
View Full Code Here

  private String getMessage(Object target, String name) {
    return ((MessageSource) target).getMessage(name, null, null, getLocale());
  }

  private Locale getLocale() {
    RequestContext requestContext = RequestContextHolder.getRequestContext();
    return (requestContext != null) ? requestContext.getExternalContext().getLocale() : LocaleContextHolder
        .getLocale();
  }
View Full Code Here

  public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base) {
    return null;
  }

  public Class<?> getType(ELContext context, Object base, Object property) {
    RequestContext requestContext = getRequestContext();
    if (base != null || requestContext == null) {
      return null;
    }
    if (ImplicitVariables.matches(property)) {
      context.setPropertyResolved(true);
View Full Code Here

      return null;
    }
  }

  public Object getValue(ELContext context, Object base, Object property) {
    RequestContext requestContext = getRequestContext();
    if (base != null || requestContext == null) {
      return null;
    }
    if (ImplicitVariables.matches(property)) {
      context.setPropertyResolved(true);
View Full Code Here

      return null;
    }
  }

  public boolean isReadOnly(ELContext context, Object base, Object property) {
    RequestContext requestContext = getRequestContext();
    if (base != null || requestContext == null) {
      return false;
    }
    if (ImplicitVariables.matches(property)) {
      context.setPropertyResolved(true);
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.