Package play.mvc.results

Examples of play.mvc.results.Error.apply()


      String type = contentElement.get("type").getAsString();
      String source = contentElement.get("source").getAsString();
      Long id = contentElement.get("id") != null ? contentElement.get("id").getAsLong() : null;
      if(type==null) {
        Error error = new Error("Type field is empty.");
        error.apply(request, response);
        return;
      }
      Content.ContentType contentType = Content.ContentType.valueOf(type.toUpperCase());
      if(contentType == null) {
        Error error = new Error(type + " is not a correct type value.");
View Full Code Here


        return;
      }
      Content.ContentType contentType = Content.ContentType.valueOf(type.toUpperCase());
      if(contentType == null) {
        Error error = new Error(type + " is not a correct type value.");
        error.apply(request, response);
        return;
      }
      if(source==null) {
        Error error = new Error("Source field is empty");
        error.apply(request, response);
View Full Code Here

        error.apply(request, response);
        return;
      }
      if(source==null) {
        Error error = new Error("Source field is empty");
        error.apply(request, response);
        return;
      }
      // Se comenta esto para permitir contenido externo
      /*if(id==null) {
        Error error = new Error("Id field is empty");
View Full Code Here

      JsonObject toElement = element.getAsJsonObject();
      Long userId = toElement.get("id").getAsLong();
      String firstName = toElement.get("firstName").getAsString();
      if(userId == null) {
        Error error = new Error("The id field of " + firstName + " is empty.");
        error.apply(request, response);
        return;
      }
      User to = User.findById(userId);
      if(to == null) {
        Error error = new Error(firstName + " is not a registered user.");
View Full Code Here

        return;
      }
      User to = User.findById(userId);
      if(to == null) {
        Error error = new Error(firstName + " is not a registered user.");
        error.apply(request, response);
        return;
      }
     
      receivers.add(to);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.