반응형
static 필드에 @Autowired 어노테이션 사용법.
@Autowired
private static MyService myService;
위 방식으로 사용하면 exception 발생.
아래와 같이 사용해야함.
private static MyService myService;
@Autowired(required=true)
public void setMyService(MyService _myService) {
myService = _myService;
}
반응형
'프로그래밍 > Java' 카테고리의 다른 글
[이클립스] jad clipse 플러그인. (0) | 2011.10.26 |
---|---|
reflection을 이용한 오브젝트의 함수 실행. (1) | 2011.09.20 |
String -> Json (0) | 2011.09.19 |
http request post data 읽기. (0) | 2011.09.19 |
Redirect VS Forward (0) | 2011.08.31 |