newbie
newbie

Reputation: 24645

i18n cannot find resource bundle

I have placed translation file app_fi.properties in folder /WEB-INF/i18n/, but I get following error message. What could be wrong here?

java.util.MissingResourceException: Can't find bundle for base name WEB-INF.i18n.app, locale fi_FI  java.util.ResourceBundle.throwMissingResourceException(Unknown Source)  java.util.ResourceBundle.getBundleImpl(Unknown Source)
    java.util.ResourceBundle.getBundle(Unknown Source)  

Upvotes: 1

Views: 7476

Answers (2)

rsp
rsp

Reputation: 23383

Did you add the WEB-INF/i18n folder to the containers' classpath?

Upvotes: 1

helios
helios

Reputation: 13851

You have to put app_*.properties in /WEB-INF/classes (or somewhere in the classpath) and load it as it were a class.

By example:

/WEB-INF/classes/i18n/pack2/app_fi.properties

is loaded with

ResourceBundle.getBundle("i18n.pack2.app", ...)

Upvotes: 6

Related Questions