spring使用ApplicationContext读取资源文件

    @Autowired
    private ApplicationContext applicationContext;
Resource resource = applicationContext.getResource("classpath:com/springdemo/resource/test.txt")

 

posted @ 2017-05-05 10:56  zhao1949  阅读(1213)  评论(0编辑  收藏  举报