

input 값에 대한 validation을 하고 싶을 때, 1. view 쪽에서 API를 호출한다. 2. API는 실패에 대한 메시지를 model에 담아서 보내준다. 3. view 에서는 model에 있는 실패 메세지가 있는지 thymeleaf를 사용해서 처리한다. 요러한 플로우를 통해서 이루어진다고 생각해요. (더 멋지게 구현할수도 있겠지만요...) 지금은 input 값이 하나라서 다행이지만, 회원가입 같은 여러개의 필드값을 받는다면 어떨까요? 해당 API에서 그 필드값들을 하나씩 분석해서 model에 메세지를 넣어주는건 쉽지 않을거에요. 조금의 설정만 해두면, 위와 같은 문제를 쉽게 해결해줄 수 있는 '@Valid' 가 있습니다!! @Valid - 클라이언트 측에서 넘어온 데이터를 객체에 바인딩할 때..

발생원인 프로젝트를 개발하던 중, C 드라이브에 있는 JDK가 지저분하게 쌓여있어서, 쓰는 것들만 남기고 다 지웠습니다. 실행이 잘 되던 프로젝트를 다시 빌드 해보니, 에러 발생!! "FAILURE: Build failed with an exception. - What went wrong: Execution failed for task ':compileJava'. > java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x4bbf714f) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in mod..

1. 에 현재 날짜를 기준으로 value값을 변경해주어야 했다. 2. 계약 만료일은 현재 날짜를 기준으로 +2년을 해주어야 한다. 3. 현재 시각은 2022-03-20 01:56:23 인데, ISOString()으로 설정하니까 하루차이가 난다. 1,2,3 을 해결하는 코드만 보면 이렇다. const offset = new Date().getTimezoneOffset() * 60000; const date = new Date(Date.now() - offset); $("input[name=startDate]").attr('value', date.toISOString().substring(0, 10)) date.setFullYear(date.getFullYear()+2) $("input[name=endDat..

Execution failed for task ':test'. > No tests found for given includes: [com.sjs.jsvill.repository.MemoRepositoryTests.testInsertDummies](filter.includeTestsMatching) * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. 해결책 : ctrl+alt+s -> settings -> Build Tools -> Gradle 테스트구동을 Gradle -> inte..

오류 내용 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.J..