package com.example.demo_3_1;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
/**
* Created by WangBin on 2017/4/18.
*
*/
@Configuration
@ComponentScan("com.example.demo_3_1")
public class AwareConfig {
}
package com.example.demo_3_1;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
/**
* Created by WangBin on 2017/4/18.
*
*/
public class Main {
public static void main(String[] args) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AwareConfig.class);
AwareService awareService = context.getBean(AwareService.class);
awareService.outputResult();
}
}