首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

spring通配符jar资源加载有关问题

2012-08-21 
spring通配符jar资源加载问题jar资源加载问题?问题:Spring加载jar中的:classpath*:xxx/applicationContext

spring通配符jar资源加载问题

jar资源加载问题

?

    问题:Spring加载jar中的:classpath*:xxx/applicationContext*.xml文件失败环境:
      jar文件中文件: classpath*:xxx/applicationContext*.xmlEclipse使用“导出”jar时未选择”Add directory entries”(选择后,不会出现此问题)如下图:
      spring通配符jar资源加载有关问题
      ?
    分析:
      代码:
      ?因为spring支持通配符加载资源,所以使用:Resource[] rootDirResources = getResources(rootDirPath);来加载目录,再定位子资源subPattern的路径,即可支持通配符加载资源
    1 楼 skzr.org 2011-02-14   http://download.oracle.com/javase/6/docs/api/index.html

    JDK提供了一个JarFile的类

热点排行