2013-02-28 18 views
1

舉我在一個Grails應用,我想使用像src/java/resourcebundle/abc.properties特定的資源包創建src/java下一個新的包。當我從src/java內的其他類使用它時,這工作正常。我想在加載應用程序時加載這個文件。所以我想它添加到bootstrap.groovy負載應用的啓動資源包中的Grails

def init = { -> def myProperties = ResourceBundle.getBundle("src/java/resourcebundle.abc")}. 

我得到一個異常

Error executing bootstraps: Can't find bundle for base name src/java/resourcebundle.abc, locale en_US 

如何在引導加載資源包有什麼建議?

回答

1

remove src/java?或者使用ClasspathResource?