2014-05-23 4 views

답변

3

큰 경우 내가 null을 얻고있다

@Transactional 
public static Result save() { 
    try { 
     JsonNode json = request().body().asJson(); 

     if (json == null) { 
      return ok(SEND_JSON_OBJECT); 
     } 
    } catch (Exception e) {} 
} 

을 너무 큰 null 때 조치 : http://www.playframework.com/documentation/2.2.x/JavaBodyParsers

워드 프로세서 :

// Accept only 10KB of data. 
@BodyParser.Of(value = BodyParser.Text.class, maxLength = 10 * 1024) 
public static Result index() { 
    if(request().body().isMaxSizeExceeded()) { 
    return badRequest("Too much data!"); 
    } else { 
    return ok("Got body: " + request().body().asText()); 
    } 
} 
+0

는 최대 크기에 제한이 있나요? – Niamath