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
如何在引導加載資源包有什麼建議?