일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- IntelliJ#인텔리제이#인텔리#단축키
- 자바#Java#배열예시#연습#기초다지기
- Java#컴파일러#자바컴파일러#
- #java#JAVA#프로그래밍#웹개발자
- 개발자#it도서#도메인#DDD#ddd
- 쿼리스트링#쿼리문자열#바인딩
- Java#java#자바#다오#디티오#브이오#dao#dto#vo
- Resource #
- spring#Spring#RequestBody#ResponseBody
- 자바
- java
- 국비지원JAVA#국비교육JAVA#국비지원자바#국비교육자바#JSP#SERVLET#서블릿#
- 국비지원JAVA#국비지원자바#프로그랭#JSP#국비지원JSP#국비교육JSP#웹개발자#코딩
- #
- html#HTML#프론트엔드#개발자#코딩#국비지원#국비교육#국비지원프론트엔드#국비지원HTML#국비지원html#국비프론트엔드
- 프로그래밍
- db#데이터베이스#오라클#sql
- Java#java#메모리영역#클래스로더#가비지컬렉터
- Spring#spring#스프링#스프링프레임워크#스프링의존성주입#스프링생성자#스프링기본#국비지원#국비교육#국비지원스프링
- Spring#spring#스프링#스프링프레임워크#스프링자동주입#스프링생성자#스프링기본#국비지원#국비교육#국비지원스프링
- 국비지원#국비교육#국비지원자바#국비교육자바#css#HTML#JAVA
- 항해플러스#항해#항해플러스3기#회고
- 개발자도서#개발자책#도메인#DDD#도메인주도개발시작하기#개발스터디#
- tibero#티베로#이중화#failvover
- Java#정처기#비트연산자#정보처리기사
- 항해99 #항해플러스 #주니어개발자 #주니어개발자역량강화 #주니어개발자멘토링 #개발자사이드프로젝트 #코딩부트캠프 #코딩부트캠프후기
- Java#JAVA#매개변수
- 국비지원자바#국비교육자바#국비지원java#국비교육java#자바스크립트#프론트엔드
- 국비지원JAVA
- 국비지원#국비교육
- Today
- Total
목록스프링Spring (34)
개린이 개발노트
'뉴렉처' 님의 채널(www.youtube.com/user/newlec1)을 바탕으로 제작한 블로그 글입니다:) [Spring Framework] Application Context 사용하기 반갑습니다 (tistory.com) [Spring Framework] Application Context 사용하기 '뉴렉처' 님의 채널(www.youtube.com/user/newlec1)을 바탕으로 제작한 블로그 글입니다:) 이번 시간에는 이전에 작성한 setting.xml을 java 코드에서 어떻게 가져와 사용하는지에 대해서 배워보고자 합니다. programming-workspace.tistory.com 위 포스팅 내용참조했습니다. ApplicationContext란 무엇인지? ApplicationContext란..
Bean을 정의할 때 주입할 객체는 생성자를 통한 주입이나 setter를 통한 주입을 사용했다. Spring에서는 객체를 주입할 때 자동으로 주입될 수 있도록 설정이 가능하다. 자동 주입은 이름, 타입, 생성자를 통할 수 있으며 auto wire라는 용어로 부른다. 이름을통한주입 byName: 빈 객체의 property 이름과 정의된 Bean의 이름이 같은 것을 찾아 자동으로 주입함. package sanghoon.main; import org.springframework.context.support.ClassPathXmlApplicationContext; import sanghoon.beans.TestBean1; public class MainClass { public static void main(S..
컬렉션 주입 Bean을 정의할 때 주입해야 하는 멤버가 컬렉션인 경우 컬렉션이 관리할 객체를 초기에 설정할 수 있다. 여기에 List, Map, Set, Property 사용 package sanghoon.main; import java.util.List; import java.util.Map; import java.util.Set; import org.springframework.context.support.ClassPathXmlApplicationContext; import sanghoon.beans.DataBean; import sanghoon.beans.TestBean; public class MainClass { public static void main(String[] args) { // TO..
Bean을 정의할 때 Bean 객체가 가지고 있을 기본 값을 생성자가 아닌 Setter 메서드를 통해 주입할 수 있다. name: 데이터를 주입할 property의 이름 value: 기본 자료형 및 문자열을 주입할 때 사용하는 속성 ref: 객체의 주소값을 주입할 때 사용하는 속성 package sanghoon.main; import org.springframework.context.support.ClassPathXmlApplicationContext; import sanghoon.beans.TestBean; public class MainClass { public static void main(String[] args) { // TODO Auto-generated method stub TestBean ..
의존성 주입(Dependency Injection) 의존성 주입은 Spring에서 아주 중요한 개념이자 장점 bean객체 생성시 bean 객체가 관리할 값이나 객체를 주입하는 것을 의미 bean 객체 생성 후 bean 객체가 가질 기본값을 자바코드로 설정하는 것이 아닌 bean을 정의하는 xml코드에서 정의하는 개념 Bean을 정의할 때 constructor-arg 태그를 이용해 주입하게 되면 생성자를 통해 주입할 수 있음. Bean 객체를 생성할 때 객체의 기본값을 생성자를 통해 주입가능. package sanghoon.main; import org.springframework.context.support.ClassPathXmlApplicationContext; import sanghoon.beans...
BeanPostProcessor Bean 객체를 정의할 때 init-method 속성을 설정하면 객체가 생성될 때 자동으로 호출될 메서드를 지정할 수 있다. 이때 BeanPostProcessor 인터페이스를 구현한 클래스를 정의하면 Bean 객체를 생성할 때 호출될 init 메서드 호출을 가로채 다른 메서드를 호출할 수 있도록 할 수 있다. Spring에서는 객체가 생성될 때 init-method로 지정된 메서드가 호출되기 전, 후에 다른 메서드를 호출할수 있도록 지원하고 있다. 관련예제 ↓ 메인클래스 package sanghoon.main; import org.springframework.context.support.ClassPathXmlApplicationContext; import sanghoon...
Spring의 Bean은 다음과 같은 상황일 때 객체가 생성된다. 싱글톤인 경우 xml파일을 로딩할 때 객체가 생성된다. 싱글톤이고 lazy-unit 속성이 true일경우 getBean메서드를 사용할 때 객체가 생성된다. prototype일 경우 getBean메서드를 사용할 때 객체가 생성된다. Spring의 Bean은 다음과 같은 상황일 때 객체가 소멸된다. IoC컨테이너가 종료 때 객체가 소멸된다. (==close 메서드를 호출할 때) 메서드가 없을 경우 default-init-method 아무일도 발생 x default destroy method 아무일도 발생x init-method 오류발생 destroy 오류 발생 Spring 에서는 객체가 생성될 때 호출될 메서드가 소멸될 때 호출될 메서드를 지..
class: 객체를 생성하기 위해 사용할 클래스를 지정한다. id: Bean 객체를 가져오기 위해 사용하는 이름을 저장한다. lazy-init: 싱글톤인 경우 xml을 로딩할 때 객체 생성 여부를 설정한다. true: xml로딩 시 객체를 생성하지 않고 객체를 가져올 때 생성한다. scope: 객체의 범위를 설정한다. slingeton: 객체를 하나만 생성해서 사용 prototype: 객체를 가져올 때 마다 객체를 생성한다. package sanghoon.main; import org.springframework.context.support.ClassPathXmlApplicationContext; import sanghoon.beans.TestBean; public class MainClass { pub..
코드 필요하신분 복붙하시라우~!