문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
springframework [2013/12/05 15:51] kwon37xi |
springframework [2022/10/24 14:01] (현재) kwon37xi |
||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| ====== Spring Framework ====== | ====== Spring Framework ====== | ||
| * [[http:// | * [[http:// | ||
| + | * [[https:// | ||
| * [[http:// | * [[http:// | ||
| + | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| ===== Offline(No Internet Connection) 상태에서의 Spring 설정 파일 ===== | ===== Offline(No Internet Connection) 상태에서의 Spring 설정 파일 ===== | ||
| * [[http:// | * [[http:// | ||
| + | |||
| + | ===== 기본 Context 실행 ===== | ||
| + | <code java> | ||
| + | public class Main { | ||
| + | private static final Logger log = LoggerFactory.getLogger(Main.class); | ||
| + | public static void main(String[] args) { | ||
| + | |||
| + | AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext([ProjectContext].class); | ||
| + | try { | ||
| + | |||
| + | UserService userService = context.getBean(UserService.class); | ||
| + | } finally { | ||
| + | context.close(); | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| ===== 등록된 모든 bean 목록보기 ===== | ===== 등록된 모든 bean 목록보기 ===== | ||
| 줄 13: | 줄 36: | ||
| for (String name : bf.getBeanDefinitionNames()) { | for (String name : bf.getBeanDefinitionNames()) { | ||
| - | System.out.println(name + " | + | System.out.println(name + " |
| } | } | ||
| </ | </ | ||
| + | |||
| + | ===== 동일한 이름의 Bean 중복 정의 ===== | ||
| + | 동일한 이름의 Bean을 동일 컨텍스트(부모/ | ||
| + | [[http:// | ||