2012-09-18 39 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会使框架负载从肌肉发展属性文件每个查找。

相关问题