inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

자바 스프링 프레임워크(renew ver.) - 신입 프로그래머를 위한 강좌

DI(Dependency injection)

생성자 객체 질문

111

안준영 (탈퇴)

작성한 질문수 0

0

삭제된 글입니다

spring java

답변 4

0

안준영 (탈퇴)

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:c="http://www.springframework.org/schema/c"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="bean1" class="board.test2"/>
    
    <bean id="bean2" class="board.test2_1">
    	<constructor-arg ref="bean1"></constructor-arg>
    </bean>
</beans>

0

안준영 (탈퇴)

package board;

public class test2_1 {
	
	test2 t2;
	
	public test2_1(test2 t2) {
		this.t2 = t2;
	}
	
	public void a() {
		System.out.println("test"+t2.a);
	}
}

0

안준영 (탈퇴)

public class test2 {
	int a=100;
}

0

안준영 (탈퇴)

import org.springframework.context.support.*;

public class test {

	public static void main(String[] args) {
		
		GenericXmlApplicationContext ctx = new GenericXmlApplicationContext("classpath:applicationContext.xml");
		test2_1 t = ctx.getBean("bean2", test2_1.class);
		t.a();
		
		ctx.close();
	}

}

spring mvc project 안뜸...

0

172

1

Project 'ch02_pjt_01' has no explicit encoding set ch02_pjt_01 /ch02_pjt_01 No explicit project encoding

0

2075

1

xml 부분 오류가 나옵니다.

0

302

1

spring legacy project 발견되지 않아서 문의 드립니다!

0

672

1

StudentDao파일은 생성자가 없는데 왜그런가요?

0

383

1

스프링 레거시 프로젝트 생성 오류 질문드립니다.

0

390

1

application context.xml 관련 문의

0

572

2

StudentAssembler 클래스 질문드립니다.

0

341

0

sts를 설치하니까 해당 오류때문에 진도를 못나가고있습니다..

0

1055

1

qualifier 를 왜 [퀄리필러]로 발음 하시는지 ㅠㅠ 처음에 잘 못알아들엇네요

2

472

0

spring MVC project 가 보이지 않아요

0

484

1

'커넥션 풀' 등 DB와 연동하는 setup 에서의 유저정보 노출의 문제

0

322

0

memLogin 메서드에서 @RequestParam으로 받을시

0

229

0

model 파라미터가 들어온다고 하셨는데

0

275

1

import 시, pom.xml 파일 인식 못함

0

786

1

해결법 - The type org.springframework.context.ConfigurableApplicationContext cannot be resolved.

0

1380

0

12강 어노테이션에서 MainClassUseConfiguration.java 이거 돌리면 Cannot load configuration class: ems.member.configuration.MemberConfig 에러 나오는데 어떻게 해결하나요

0

1439

2

질문드립니다!

0

258

0

STS 설치와 MVC 프로젝트 생성 에러

0

336

0

처음 시작하며 compiler path 또는 version 관련 에러로 run 안될시

1

296

1

Join 과 Main으로 가는 링크 질문 (17강 13분)

0

232

0

싱글톤이 뭔가요..

0

917

2

14강 STS3 설치시 마켓플레이스에서 찾을 수 없을 때 해결방법

3

2854

0

이런 에러가 나오는데요. 왜 그런 걸까요?

0

309

1