Fri May 31 18:48:32 KST 2024 There was an unexpected error (type=Internal Server Error, status=500).이라는 오류가 발생.detail.html 에서는 board.fileAttached ==1 을 이용한 파일작성의 테이블을 작성해주었는데,org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field 'fileAttached' cannot be found on object of type Thymeleaf 템플릿에서 해당 DTO에서 필드를 찾을 수가 없다는 오류가 발생. 따라서 fileAttached 필드를 추가하여 동작을 시켜보니 정상적으..
Optional 클래스는 null을 안전하게 처리할 수 있도록 다양한 메서드를 제공합니다. ( NullPointerException을 방지) 1.Get()Optional optionalString = Optional.of("Hello");String value = optionalString.get(); // "Hello" get(): Optional 객체에 저장된 값을 반환합니다. 값이 없는 경우 NoSuchElementException이 발생합니다.2.IsPresent()Optional optionalString = Optional.of("Hello");if (optionalString.isPresent()) { System.out.println(optionalString.get()); // "H..