spring部分注解
@Controller @SpringBootApplication @Configuration @ComponentScan(basePackages={"first","third"}) //配置扫描包 @PropertySource(value={"classpath:jdbc.properties"}) //指定读取配置文件 public class HelloApplication { @Value("${url}") private String url; @Bean public DataSource dataSource() { System.out.println(url); DruidDataSource ds = new DruidDataSource(); ds.setUrl(url); return ds; } public static void main(String[] args) { SpringApplication.run(HelloApplication.class, args); } }