Spring Annotation
컴포넌트 스캔과 자동 의존관계 설정
Annotation
설명
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
public @interface Controller {
/**
* The value may indicate a suggestion for a logical component name,
* to be turned into a Spring bean in case of an autodetected component.
* @return the suggested component name, if any (or empty String otherwise)
*/
@AliasFor(annotation = Component.class)
String value() default "";
}예제 코드
자바 코드로 직접 스트링 빈 등록하기
언제 사용해야할까?
Last updated