classPath和classPath 的區別

2021-07-05 11:47:40 字數 533 閱讀 9870

classpath和classpath*的區別:

public

static

voidmain(string args) catch(ioexception e) {

//todo auto-generated catch block

e.printstacktrace();

5)        當"classpath*:conf/**/*hibernate.cfg.xml"時,不僅會載入conf下的hibernate.cfg.xml和conf.admin下的admin-hibernate.cfg.xml,還會載入jar包下的這兩個檔案。

classpath*

的存在主要是為載入不同

jar包同路徑下的各個同名檔案,例如

myjar1.jar

包裡conf

下的hibernate.cfg.xml

和myjar2.jar

包裡conf

下的hibernate.cfg.xml。

ps

classpath 與classpath 的區別

classpath是指 web inf資料夾下的classes目錄 1.解釋classes含義 1 存放各種資源配置檔案 init.properties log4j.properties,struts.xml 2 存放模板檔案 eg.actionerror.ftl 3 存放class檔案 對應的是專...

classpath 與classpath 的區別

spring可以通過指定classpath 與classpath 字首加路徑的方式從classpath載入檔案,如bean的定義檔案.classpath 的出現是為了從多個jar檔案中載入相同的檔案.classpath 只能載入找到的第乙個檔案.通過使用下面的 則可以將兩個jar包中的檔案都載入進來...

classpath和springmvc配置檔案位置

在springmvc中web.xml中配置springmvc.xml檔案的路徑時用到了classpath,這個classpath就是用來指定要載入的springmvc.xml配置檔案的路徑的。當不指定具體的檔案路徑,即不使用classpath時,會預設dispatchservlet的配置檔案位置在w...