Package org.springframework.webflow.execution

Examples of org.springframework.webflow.execution.RequestContext


      return false;
    }
  }

  public void setValue(ELContext elContext, Object base, Object property, Object value) {
    RequestContext requestContext = getRequestContext();
    if (base != null || requestContext == null) {
      return;
    }
    String attributeName = property.toString();
    if (requestContext.getRequestScope().contains(attributeName)) {
      elContext.setPropertyResolved(true);
      requestContext.getRequestScope().put(attributeName, value);
    } else if (requestContext.getFlashScope().contains(attributeName)) {
      elContext.setPropertyResolved(true);
      requestContext.getFlashScope().put(attributeName, value);
    } else if (requestContext.inViewState() && requestContext.getViewScope().contains(attributeName)) {
      elContext.setPropertyResolved(true);
      requestContext.getViewScope().put(attributeName, value);
    } else if (requestContext.getFlowScope().contains(attributeName)) {
      elContext.setPropertyResolved(true);
      requestContext.getFlowScope().put(attributeName, value);
    } else if (requestContext.getConversationScope().contains(attributeName)) {
      elContext.setPropertyResolved(true);
      requestContext.getConversationScope().put(attributeName, value);
    }
  }
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

  public void testAny() throws Exception {
    String expression = "*";
    TransitionCriteria criterion = (TransitionCriteria) converter.convertSourceToTargetClass(expression,
        TransitionCriteria.class);
    RequestContext ctx = getRequestContext();
    assertTrue("Criterion should evaluate to true", criterion.test(ctx));
    assertSame(WildcardTransitionCriteria.INSTANCE, converter.convertSourceToTargetClass("*",
        TransitionCriteria.class));
    assertSame(WildcardTransitionCriteria.INSTANCE, converter.convertSourceToTargetClass("",
        TransitionCriteria.class));
View Full Code Here

  public void testStaticEventId() throws Exception {
    String expression = "sample";
    TransitionCriteria criterion = (TransitionCriteria) converter.convertSourceToTargetClass(expression,
        TransitionCriteria.class);
    RequestContext ctx = getRequestContext();
    assertTrue("Criterion should evaluate to true", criterion.test(ctx));
  }
View Full Code Here

  public void testTrueEvaluation() throws Exception {
    String expression = "${flowScope.foo == 'bar'}";
    TransitionCriteria criterion = (TransitionCriteria) converter.convertSourceToTargetClass(expression,
        TransitionCriteria.class);
    RequestContext ctx = getRequestContext();
    assertTrue("Criterion should evaluate to true", criterion.test(ctx));
  }
View Full Code Here

  public void testFalseEvaluation() throws Exception {
    String expression = "${flowScope.foo != 'bar'}";
    TransitionCriteria criterion = (TransitionCriteria) converter.convertSourceToTargetClass(expression,
        TransitionCriteria.class);
    RequestContext ctx = getRequestContext();
    assertFalse("Criterion should evaluate to false", criterion.test(ctx));
  }
View Full Code Here

        return new StaticExpression(null);
      }
    });
    TransitionCriteria criterion = (TransitionCriteria) converter.convertSourceToTargetClass("doesnt matter",
        TransitionCriteria.class);
    RequestContext ctx = getRequestContext();
    assertFalse("Criterion should evaluate to false", criterion.test(ctx));
  }
View Full Code Here

    /**
     * Ensures all passed attributes are part of the valid query attribute set.
     */
    public void validatePersonLookup(PersonQuery personQuery, MessageContext context) {
        final RequestContext requestContext = RequestContextHolder.getRequestContext();
        final ExternalContext externalContext = requestContext.getExternalContext();
        final Set<String> queryAttributes = personLookupHelper.getQueryAttributes(externalContext);
       
        final Map<String, Attribute> attributes = personQuery.getAttributes();
        for (final String attribute : attributes.keySet()) {
            if (!queryAttributes.contains(attribute)) {
View Full Code Here

    /**
     * Ensures all passed attributes are part of the valid query attribute set.
     */
    public void validateAttributesForm(AttributeSwapRequest attributeSwapRequest, MessageContext context) {
        final RequestContext requestContext = RequestContextHolder.getRequestContext();
        final ExternalContext externalContext = requestContext.getExternalContext();
        final Set<String> swappableAttributes = this.attributeSwapperHelper.getSwappableAttributes(externalContext);
       
        final Map<String, Attribute> currentAttributes = attributeSwapRequest.getCurrentAttributes();
        this.checkAttributesMap(context, "currentAttributes", swappableAttributes, currentAttributes);

View Full Code Here

    public final void postHandle(final HttpServletRequest request, final HttpServletResponse response, final Object o, final ModelAndView modelAndView) throws Exception {
        if (!"POST".equals(request.getMethod())) {
            return;
        }

        RequestContext context = (RequestContext) request.getAttribute("flowRequestContext");
       
        if (context == null || context.getCurrentEvent() == null) {
            return;
        }
       
        // User successfully authenticated
        if (SUCCESSFUL_AUTHENTICATION_EVENT.equals(context.getCurrentEvent().getId())) {
            return;
        }

        // User submitted invalid credentials, so we update the invalid login count
        updateCount(request, this.usernameParameter);
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.