Package br.com.caelum.vraptor.http

Examples of br.com.caelum.vraptor.http.InvalidParameterException


                    parameters.setParameter(item.getFieldName(), item.getName());
                    request.setAttribute(item.getName(), fileInformation);

                    logger.debug("Uploaded file: " + item.getFieldName() + " with " + fileInformation);
                } catch (Exception e) {
                    throw new InvalidParameterException("Cant parse uploaded file " + item.getName(), e);
                }
            } else {
                logger.debug("A file field was empty: " + item.getFieldName());
            }
        }
View Full Code Here


      request.setParameter(name, name);
      request.setAttribute(name, upload);

      logger.debug("Uploaded file: {} with {}", name, upload);
    } catch (IOException e) {
      throw new InvalidParameterException("Cant parse uploaded file " + item.getName(), e);
    }
  }
View Full Code Here

      request.setParameter(name, name);
      request.setAttribute(name, upload);

      logger.debug("Uploaded file: {} with {}", name, upload);
    } catch (IOException e) {
      throw new InvalidParameterException("Cant parse uploaded file " + item.getName(), e);
    }
  }
View Full Code Here

  }
  private void handleException(Target<?> target, Throwable e) {
    if (e.getClass().isAnnotationPresent(ValidationException.class)) {
      errors.add(new SimpleMessage(target.getName(), e.getLocalizedMessage()));
    } else if (e.getCause() == null) {
      throw new InvalidParameterException("Exception when trying to instantiate " + target, e);
    } else {
      handleException(target, e.getCause());
    }
  }
View Full Code Here

  }
  private void handleException(Target<?> target, Throwable e) {
    if (e.getClass().isAnnotationPresent(ValidationException.class)) {
      errors.add(new ValidationMessage(e.getLocalizedMessage(), target.getName()));
    } else if (e.getCause() == null) {
      throw new InvalidParameterException("Exception when trying to instantiate " + target, e);
    } else {
      handleException(target, e.getCause());
    }
  }
View Full Code Here

      parameters.setParameter(name, name);
      request.setAttribute(name, upload);

      logger.debug("Uploaded file: {} with {}", name, upload);
    } catch (IOException e) {
      throw new InvalidParameterException("Cant parse uploaded file " + item.getName(), e);
    }
  }
View Full Code Here

      Throwable cause = e.getCause();
      if (cause.getClass().isAnnotationPresent(ValidationException.class)) {
        errors.add(new ValidationMessage(cause.getLocalizedMessage(), key));
      } else {
        throw new InvalidParameterException("unable to parse expression '" + key + "'", e);
      }

    } catch (NoSuchPropertyException ex) {
      // TODO optimization: be able to ignore or not
      logger.debug("cant find property for expression {} ignoring", key);
View Full Code Here

  private OgnlContext createOgnlContextFor(Parameter param, ResourceBundle bundle) {
    OgnlContext context;
    try {
      context = createOgnlContext(new GenericNullHandler(removal).instantiate(param.actualType()));
    } catch (Exception ex) {
      throw new InvalidParameterException("unable to instantiate type " + param.type, ex);
    }
    context.setTraceEvaluations(true);
    context.put("rootType", param.type);
    context.put("removal", removal);
View Full Code Here

  }
  private void handleException(Target<?> target, Throwable e) {
    if (e.getClass().isAnnotationPresent(ValidationException.class)) {
      errors.add(new SimpleMessage(target.getName(), e.getLocalizedMessage()));
    } else if (e.getCause() == null) {
      throw new InvalidParameterException("Exception when trying to instantiate " + target, e);
    } else {
      handleException(target, e.getCause());
    }
  }
View Full Code Here

      request.setParameter(name, name);
      request.setAttribute(name, upload);

      logger.debug("Uploaded file: {} with {}", name, upload);
    } catch (IOException e) {
      throw new InvalidParameterException("Can't parse uploaded file " + item.getName(), e);
    }
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.http.InvalidParameterException

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.