Edit i18 properties in runtime
I have several message bundle files (eg. messages.properties, messages_de.properties, ...) and I need to edit those files dynamically in runtime (without restart app server).
For example, I would have html form which will l开发者_JS百科oad each file (select box), show properties to the user and user will have ability to change property's value.
I use java 1.6 with jboss 5.1.
Is there any service in jboss which I can use?
Thanks.
You can use java.util.Properties class. It provides methods to load, store the .properties file, to get and set the properties and more. For more information on how to use check this link from Oracle.
I think you should better store the dynamic info in database, it will be easier to manage the data, when it becomes large.
Then you may provide a subclass of java.util.ResourceBundle
to handle gettting the keys/values for your locale. That subclass should use database to retrieve the key-value pairs.
精彩评论