I'm doing a JSF 2.0 application on Tomcat 6.x. I have a resource bundle in different languages, is it possible to externalize the properties files outside the webapp?
For the moment I have this in my faces-config.xml:
<locale-config>
<default-locale>fr</default-locale>
<supported-locale>en</supported-locale>
<supported-locale>es</supported-locale>
</locale-config>
<resource-bundle>
<base-name>front</base-name>
<var>messages</var>
</resource-bundle>
What should I do?
Thanks.
Yes, that's definitely possible. To the point, just put the files in the classpath. You can do that by placing it in any of existing paths covered by the webapp's runtime classpath, or by adding the new path to the webapp's runtime classpath.
You could add a new path to the classpath by specifying it in shared.loader
of Tomcat's /conf/catalina.properties
. Assuming that you've placed front*.properties
files in /var/webapp/conf
folder, then you need to specify the shared.loader
as follows:
shared.loader = /var/webapp/conf