Hi!
I have a problem when i'm trying to load a properties file to a template using resourceBundle.
I'm trying to load it using:
ResourceBundle rb = ResourceBundle.getBundle("com.freemarker", new Locale("es"));
the property file is called "message_es" locate at "com.freemarke". I'm sending the properties to the template using:
dataModel.put("local", rb);
When i'm trying to call a property from the template i'm calling this way:
${local.welcome}
But it doesn't work. I'm just getting this error
FreeMarker template error:
The following has evaluated to null or missing:
==> local [in template "helloWorld.ftl" at line 5, column 4]
I suppose it have to be on the way i'm calling the properties file. But i don't know how to fix it.
Plz let me know if i'm doing something wrong... and thanks :)
According the error message,
local
is eithernull
or isn't present in the data model at all. The strange thing is thatResourceBundle.getBundle(...)
should throw exception instead of returningnull
... Anyway, double check things, as it should work as far as I see.Was this solved, can this be closed, or there will be more information?
I'm closing this as there was no answer regarding the suspected cause of this problem. (Repopen if think it's still a FreeMarker bug.)
Last edit: Dániel Dékány 2015-09-19