2012-09-18 61 views

回答

2

它們作爲java.util.ResourceBundle實例存儲在XWork核心庫中的LocalizedTextUtil中的靜態ConcurrentMap中。

默認情況下,ResourceBundles緩存在內存中。

2

默認情況下,它存儲在內存中。但是如果你想讓框架檢查每個查找的屬性文件,你可以這樣做。這對於開發來說是件好事。

你可以在你的struts.properties文件中配置這樣的東西。以下內容來自struts-default.properties,作爲這種配置的評論樣板。

### when set to true, Struts will act much more friendly for developers. This 
### includes: 
### - struts.i18n.reload = true 
### - struts.configuration.xml.reload = true 
### - raising various debug or ignorable problems to errors 
### For example: normally a request to foo.action?someUnknownField=true should 
###    be ignored (given that any value can come from the web and it 
###    should not be trusted). However, during development, it may be 
###    useful to know when these errors are happening and be told of 
###    them right away. 
struts.devMode = false 

### when set to true, resource bundles will be reloaded on _every_ request. 
### this is good during development, but should never be used in production 
struts.i18n.reload=false 

WEB-INF/classes/struts.properties文件中設置這兩種屬性true會使框架負載從肌肉發展屬性文件每個查找。

相關問題