전체 글

나는 내가 생각한 것보다 훨씬 강하다
Spring/공부

책[스프링부트와 AWS로 혼자 구현하는 웹 서비스] SecurityConfig 작성시 WebSecurityConfigurerAdapter 문제

WebSecurityConfigurerAdapter 는 지금은 deprecated가 되었기 때문에 더 이상 지원 안한다. p.180 페이지의 시큐리티 설정 코드를 약간 변경해보았다. package com.tony.springboot.book.config.auth; // 이건 자기 패키지 상황에 맞게 바꾸세요 import com.tony.springboot.book.domain.user.Role; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Bean; import org.springframework.security.config.annotation.web.builders.HttpSecurity; imp..

Spring/공부

유효성 검사 예제 with jpa

gradle plugins { id 'java' id 'org.springframework.boot' version '2.7.13' id 'io.spring.dependency-management' version '1.0.15.RELEASE' } group = 'com.example' version = '0.0.1-SNAPSHOT' java { sourceCompatibility = '1.8' } configurations { compileOnly { extendsFrom annotationProcessor } } repositories { mavenCentral() } dependencies { implementation 'org.springframework.boot:spring-boot-starter..

Spring/공부

Spring 유효성 검사 어노테이션 목록

// 필드 위에 작성한다. @Null // null만 혀용합니다. @NotNull // null을 허용하지 않습니다. "", " "는 허용합니다. @NotEmpty // null, ""을 허용하지 않습니다. " "는 허용합니다. @NotBlank // null, "", " " 모두 허용하지 않습니다. @Email // 이메일 형식을 검사합니다. 다만 ""의 경우를 통과 시킵니다. @Email 보다 아래 나올 @Patten을 통한 정규식 검사를 더 많이 사용합니다. @Pattern(regexp = ) // 정규식을 검사할 때 사용됩니다. @Size(min=, max=) // 길이를 제한할 때 사용됩니다. @Max(value = ) // value 이하의 값을 받을 때 사용됩니다. @Min(value = )..

Spring/공부

queryDSL 예제용

gradle 설정 plugins { id 'java' id 'org.springframework.boot' version '2.7.13' id 'io.spring.dependency-management' version '1.0.15.RELEASE' } group = 'com.example' version = '0.0.1-SNAPSHOT' java { sourceCompatibility = '1.8' } configurations { compileOnly { extendsFrom annotationProcessor } } repositories { mavenCentral() } dependencies { implementation 'org.springframework.boot:spring-boot-star..

synclair
메모장