码迷,mamicode.com
首页 > 编程语言 > 详细

Spring中Resource接口的前缀书写格式

时间:2017-12-02 12:56:35      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:.com   images   img   path   分享   src   png   classpath   格式   

Resource template = ctx.getResource("classpath:some/resource/path/myTemplate.txt");   //这个得到的是ClassPahResource.

Resource template = ctx.getResource("file:///some/resource/path/myTemplate.txt");         //这个得到的是FileSystemResource.


Resource template = ctx.getResource("http://myhost.com/resource/path/myTemplate.txt")   //这个得到是:URLResource.

具体的解释参考下图:

技术分享图片

 

Spring中Resource接口的前缀书写格式

标签:.com   images   img   path   分享   src   png   classpath   格式   

原文地址:http://www.cnblogs.com/1540340840qls/p/7953603.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!