我正在使用JAVA Struts2。我正在使用ActionSupport的getText()(由struts2提供)读取属性文件。应用程序运行时(内存或磁盘)存储消息包的位置?
1
A
回答
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
会使框架负载从肌肉发展属性文件每个查找。
相关问题
- 1. ehcache磁盘存储位置和访问
- 2. 序列化对象是否存储在磁盘或内存中?
- 3. 存储过程和其他对象在磁盘上的位置?
- 4. RDFlib'磁盘'存储
- 5. RavenDB磁盘存储
- 6. Memcache使用磁盘存储?
- 7. Erlang字典。它存储在内存或磁盘上
- 8. boost shared_memory_object存储磁盘中的内容?
- 9. Windows应用程序存储位置
- 10. 监控ASP.NET应用程序内存和磁盘使用情况
- 11. 什么是内存?*。内存属性控制 - 内存或磁盘?
- 12. 存储使用移动应用程序的城市或位置
- 13. 在磁盘或MongoDB上存储文件
- 14. C# - 为应用程序保留光盘内存(存储)
- 15. ehcache 2.5.0磁盘存储
- 16. 从存储器到磁盘
- 17. Java ehcache磁盘存储
- 18. Kafka Streams - 在Streams应用程序中存储在内存和磁盘中的内容
- 19. Java Script对象存储在磁盘上的位置是什么?
- 20. 如何存储信息:数据库或应用程序的内存?
- 21. 如何将存储过程的输出存储到磁盘上
- 22. 使用NSKeyedArchiver将某些内容保存到磁盘时,存储在iPhone中的位置在哪里?
- 23. 当磁盘存储达到时sqlite3
- 24. 我应该在ASP.NET应用程序中存储配置信息的位置?
- 25. MVC会话变量存储内存VS磁盘缓存
- 26. 保存视频文件的位置 - 数据库或磁盘
- 27. 如何在内存中缓存内存和磁盘缓存中的位图?
- 28. Android:在应用程序未运行或处于后台时将Firebase推送通知保存到磁盘
- 29. 内存缓冲器填满时I流上传文件时,虽然通过一个磁盘存储位置PARAM
- 30. 存储空数据时是否消耗磁盘空间?
我会让它读入某种类型的散列表。 –