-
Forum
-
메인 게시판
-
Tips
-
static 메소드 내에서 Autowired 호출
static 메소드 내에서 Autowired 호출
-
xixixaxa
(OOooOOoo)
-
이 글의 작성자
-
Offline
-
Newbie
-
덜보기
더보기
-
Posts: 47
-
Thank you received: 0
-
-
20 Jul 2022 08:44 #31920
작성자: xixixaxa
@Component
public class TestClass {
private static AutowiredTypeComponent component;
@Autowired
private AutowiredTypeComponent autowiredComponent;
@PostConstruct
private void init() {
component = this.autowiredComponent;
}
public static void testMethod() {
component.callTestMethod();
}
}
-
Forum
-
메인 게시판
-
Tips
-
static 메소드 내에서 Autowired 호출
Time to create page: 0.057 seconds