Spring 정리ver2 12

[Baedung] Best Practices for REST API Error Handling

더보기 https://www.baeldung.com/rest-api-error-handling-best-practices 링크의 포스팅 일자 2021.5.13 REST 는 Client가 서버의 resource에 access and manipulate 하는 stateless한 아키텍쳐이다 보통 REST service들은 HTTP를 활용한다 HTTP Status Codes 클라이언트가 HTTP 서버에 request하고 요청을 성공적으로 수신하면 서버는 해당 처리 여부를 response해준다 HTTP accomplishes this with five categories of status codes: 100-level (Informational) – server acknowledges a request //서버..

[Spring Framework core] 3. Validation, Data Binding, and Type Conversion (3)

3.4. Spring Type Conversion 더보기 https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#core-convert core.convert 패키지에서 일반적인 유형 변환 시스템을 제공한다. 시스템은 유형 변환 로직을 구현하기 위한 SPI와 런타임에 유형 변환을 수행하기 위한 API를 정의한다. Spring 컨테이너 내에서 이 시스템을 구현의 대안으로 사용하여 PropertyEditor외부화된 빈 속성 값 문자열을 필수 속성 유형으로 변환할 수 있다. 유형 변환이 필요한 애플리케이션의 모든 위치에서 공용 API를 사용할 수 있다. 3.4.1. Converter SPI SPI = Service Provid..

[Data JPA] Specification

더보기 https://vladmihalcea.com/spring-data-jpa-specification/ the BaseJpaRepository from the Hypersistence Utils project, which is a better alternative to the default JpaRepository from Spring Data the JpaSpecificationExecutor, which provides the Spring Data Specification filtering methods 가져와야하는 검색 Specification 을 미리 인터페이스화 한다 @Repository public interface PostCommentRepository extends BaseJpaRepo..

[Spring Framework core] 3. Validation, Data Binding, and Type Conversion (2)

3.3. Bean Manipulation and the BeanWrapper ~3.3.2. Built-in PropertyEditor Implementations 더보기 https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans-beans 3.3. Bean Manipulation and the BeanWrapper org.springframework.beans 패키지는 JavaBeans 표준을 준수한다. JavaBean은 인수가 없는 기본 생성자를 가진 클래스이며 예를 들어 bingoMadness라는 속성이 setBingoMadness(..) setter 메서드와 getBingoMadness() getter 메서드..

[Spring Framework core] 3. Validation, Data Binding, and Type Conversion (1)

더보기 https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#validation 3.1. Validation by Using Spring’s Validator Interface ~ 3.2. Resolving Codes to Error Messages Validation, Data Binding, and Type Conversion Validation을 business Logic으로 간주하면 장단점이 있고, Spring은 유효성 검사 및 데이터 바인딩을 위한 디자인을 제공하고 있다. Validation은 Web Layer에 연결되지않아야하고 localizer가 쉬워야하며 사용 가능한 모든 available validato..

[baeldung] Find the Registered Spring Security Filters

더보기 https://www.baeldung.com/spring-security-registered-filters Spring Security는 서블릿 필터 체인을 기반이다 각 필터에는 특정 책임이 있고, 구성에 따라 필터를 추가하거나 제거한다 Security Debugging 각 요청에 대한 자세한 보안 정보를 기록하는 보안 디버깅의 활성여부이다 debug 속성을 사용하여 보안 디버깅을 활성화할 수 있다 @EnableWebSecurity(debug = true) 이렇게 하면 서버에 요청을 보낼 때 모든 요청 정보가 기록된다 그리고 전체 보안 필터 체인을 볼 수 있다 Security filter chain: [ WebAsyncManagerIntegrationFilter SecurityContextPers..

[baeldung] Default Password Encoder in Spring Security 5

더보기 https://www.baeldung.com/spring-security-5-default-password-encoder Spring Security 4에서는 메모리 내 인증을 사용하여 일반 텍스트로 비밀번호를 저장할 수 있었다. 그러나 Spring Security 5는 암호 관리 프로세스에 대한 대대적인 점검으로 암호 인코딩 및 디코딩을 위한 보다 안전한 기본 메커니즘이 도입되었다 Spring Security 4 We'll start by showing a standard security configuration that provides simple in-memory authentication Spring 4 의 예시 @Configuration public class InMemoryAuthWeb..

[baeldung] Control the Session with Spring Security

XML 은 안적음**** 더보기 https://www.baeldung.com/spring-security-session Spring Security가 HTTP 세션을 제어할 수 있는 방법 When Is the Session Created? We can control exactly when our session gets created and how Spring Security will interact with it: always – A session will always be created if one doesn't already exist. ifRequired – A session will be created only if required (default). never – The framework wil..

728x90