본문 바로가기
반응형

프로그래밍87

Spring / 스프링 빈의 범위(Bean Scope) [스프링 빈의 범위(Bean Scope)]: 빈의 범위는 해당 객체가 어디까지 영향을 미치는 가를 결정하는 부분이라고 한다. 별도로 scope를 지정하지 않으면 디폴트값은 singleton이며 종류는 singletone, prototype, request, session, global session가 있는데 singletone만 다뤘다. Student.java12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455public class Student { private String name; private int age; private ArrayList hobbies; private.. 2018. 4. 7.
Spring / 스프링 빈의 생명 주기(life cycle) [스프링 빈의 생명 주기(life cycle)] OtherStudent.java12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455public class OtherStudent { private String name; private int age; private ArrayList hobbies; private double height; private double weight; public OtherStudent(String name, int age, ArrayList hobbies) { this.name = name; this.age = age; this.hobbies = ho.. 2018. 4. 7.
Spring / 스프링 컨테이너의 생명주기(lifecycle) [스프링 컨테이너의 생명주기(lifecycle)]: 스프링 컨테이너가 어떤 형식과 차례로 구동되는지를 파악해보면 될 것 같다. Student.java12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455public class Student { private String name; private int age; private ArrayList hobbies; private double height; private double weight; public Student(String name, int age, ArrayList hobbies) { this.name = name; this.. 2018. 4. 7.
Spring / xml과 Java를 같이 사용하는 방법 [xml과 Java를 같이 사용하는 방법] 1. xml파일에 Java파일을 포함시켜 사용하는 방법2. JAva파일에 xml파일을 포함시켜 사용하는 방법 AbstractApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig02.class); : class파일을 파싱할 때는 AnnotationConfigApplicationContex를 이용하고 있다. AbstractApplicationContext ctx = new GenericXmlApplicationContext("classpath:ctx_example01.xml"); : xml파일을 파싱할 때는 GenericXmlApplicationContext을 이용하고 있다. Studen.. 2018. 4. 7.
반응형