목록NULL (2)
준호씨의 블로그
freemarker에서 아무 처리를 해 주지 않은 경우 null을 대입해 주면 오류가 발생합니다. freemarker.core.InvalidReferenceException: The following has evaluated to null or missing: ==> user [in template "name" at line 1, column 9] ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use when-presentwhen-missing...
@Data @Builder public class Person { private String firstName; private String lastName; private String byName; private String phoneNumber; } 클래스가 있고 (편의상 lombok을 사용합니다.) Person person = Person.builder() .firstName("Michael") .lastName("Jordan") .byName("Air Jordan") .build(); ObjectMapper mapper = new ObjectMapper(); System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(p..