0
votes

I would like to have a dynamic resource bundle in my application. I will show a form to the user where he can edit the value of Resource Bundle. I can’t restart my application for this changes take effect. I found a solution that solves part of my problem. Using “commons-configuration” from Apache or/and this http://www.coderanch.com/t/292347/JSP/java/we-reload-property-file , i could change my “.properties” file and get the results using “ResourceBundle.getBundle” . The problem is when I try to access the property in my XHTML file like this:

<h:outputLabel value="#{msg[user.name]}" />

The value of this key is out of date.
Is there a solution for this?

Just for info, I am using spring, so I have this in my faces-config:

<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>

But I don’t think this is the problem. Anyway, another solution would be to use a session bean and get the property values accessing it. What do you think about it? Would be better store this values in my database and forget about the properties file?

1
Related: stackoverflow.com/questions/4325164/… Please note the answer of arjan. - BalusC
Thank you brother! I will try arjan code too. I have already gotten the expected results. I had a minor problem when i try to change configurations like "config.dataTable.rowsPerPage", but i think this should be a primefaces problem. - Leandro

1 Answers

0
votes

\o/

I have tested to move my resource bundle definition from my faces-config to my page using tag f:loadBundle and it worked!