Package br.com.caelum.vraptor.controller

Examples of br.com.caelum.vraptor.controller.HttpMethod


    MutableRequest request = info.getRequest();
    String controllerName = info.getRequestedUri();

    logger.debug("trying to access {}", controllerName);

    HttpMethod method = getHttpMethod(request, controllerName);
    ControllerMethod controller = router.parse(controllerName, method, request);

    logger.debug("found controller {}", controller);
    return controller;
  }
View Full Code Here


  public ControllerMethod translate(MutableRequest request) {
    String controllerName = request.getRequestedUri();

    logger.debug("trying to access {}", controllerName);

    HttpMethod method = getHttpMethod(request, controllerName);
    ControllerMethod controller = router.parse(controllerName, method, request);

    logger.debug("found controller {}", controller);
    return controller;
  }
View Full Code Here

    MutableRequest request = info.getRequest();
    String controllerName = info.getRequestedUri();

    logger.debug("trying to access {}", controllerName);

    HttpMethod method;
    try {
      method = HttpMethod.of(request);
    } catch (IllegalArgumentException e) {
      throw new MethodNotAllowedException(router.allowedMethodsFor(controllerName), request.getMethod());
    }
View Full Code Here

    MutableRequest request = info.getRequest();
    String controllerName = info.getRequestedUri();

    logger.debug("trying to access {}", controllerName);

    HttpMethod method = getHttpMethod(request, controllerName);
    ControllerMethod controller = router.parse(controllerName, method, request);

    logger.debug("found controller {}", controller);
    return controller;
  }
View Full Code Here

  }


  @Test
  public void passesTheWebMethod() throws SecurityException, NoSuchMethodException {
    HttpMethod delete = HttpMethod.DELETE;
    Route route = mock(Route.class);
    when(route.getControllerMethod()).thenReturn(anyControllerMethod());

    when(route.canHandle("/clients/add")).thenReturn(true);
    when(route.allowedMethods()).thenReturn(EnumSet.of(delete));
View Full Code Here

  }

  private boolean isAllowed(Authorizable authorizable) {
    String currentURL = getCurrentURL();
    String method = request.getMethod();
    HttpMethod httpMethod = HttpMethod.valueOf(method);
    Set<HttpMethod> httpMethods = EnumSet.of(httpMethod);
    for (Role role : authorizable.roles()) {
      if (authorizator.isAllowed(role, currentURL, httpMethods)) {
        return true;
      }
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.controller.HttpMethod

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.