Spring and Spring Boot/Class, Annotation, Library 13

Annotation : 스프링 시큐리티 관련 어노테이션 (@EnableWebSecurity, @EnableMethodSecurity, @AuthenticationPricipal)

➡️ @EnableWebSecuritySpring Security에서 웹 애플리케이션의 보안 구성을 활성화하는 데 사용되는 어노테이션으로, 웹 애플리케이션의 보안 설정을 구성할 수 있다. 또한, HTTP 요청에 대한 인증 및 권한 부여를 처리하는 WebSecurityConfigurerAdapter 클래스를 활성화시킨다.   ✅ @EnableWebSecurit의 역할 웹 보안 활성화 : Spring Security의 웹 보안 기능을 활성화하여, HTTP 요청에 대한 보안 설정을 구성할 수 있는 기반을 제공한다.보안 설정 커스터마이즈 : 예전에는 WebSecurityConfigurerAdapter를 상속하여 프로젝트의 특성에 따라 보안 설정을 커스터마이즈하는 방법을 많이 사용했으나, 최근에는 Security..

Annotaion : 데이터베이스 관련 어노테이션 (@Id, @GeneratedValue, @Column, @Query)

➡️ 데이터베이스 관련 애너테이션// EX.import javax.persistence.Entity;import javax.persistence.Id;@Entitypublic class User { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @Column(name = "user_name", nullable = false, unique = true, length = 50) private String name; public Long getId() { return id; } public void setId(Long id) { this.id = id; } ..

Annotation : 빈 등록 및 의존성 주입 관련 어노테이션 (@Controller, @RestController, @Configuration, @Component, @Autowired)

➡️ 빈(Bean) 등록 관련 애너테이션클래스 용도에 따라 다른 애너테이션을 사용하기는 하지만사실 내부 코드를 보면 @Component 애네터이션이 모두 달려 있다.  ✅ @Component클래스를 빈으로 등록하기만 해주면 될 때 사용하는 애너테이션 ✅ @Configuration클래스를 설정 파일을 등록하면서 빈으로 등록해줄 때 사용하는 애너테이션 ✅ @Repository클래스를 ORM 매핑을 하면서 빈으로 등록해줄 때 사용하는 애너테이션 ✅ @Service클래스가 비즈니스 로직을 담당하게 하면서 빈으로 등록시킬 때 사용하는 애너테이션   ✅ @Controller와 @RestController: @Controller와 @RestController는 라우터 역할을 하는 어노테이션이다. 여기서 라우터란 HT..