I've configured Locale
before in JSF applications, but for some reason I keep getting the following:
java.util.MissingResourceException: Can't find bundle for base name com.cleanup.bundle.messages, locale es
<application>
<resource-bundle>
<base-name>com.cleanup.bundle.messages</base-name>
<var>msg</var>
</resource-bundle>
<locale-config>
<default-locale>es</default-locale>
<supported-locale>en</supported-locale>
</locale-config>
</application>
The .properties
files:
For some reason I just can't make it work, please don't mark as duplicate since I've already verified with these:
My configuration is exactly the same as I've used in the past but.. nothing works, I even tried to set the local to the default locale:
<f:view locale="#{languageBean.locale}">
With a bean like so:
@Named(value = "languageBean")
@SessionScoped
public class LanguageBean implements Serializable {
private Locale locale;
@PostConstruct
public void init() {
locale = FacesContext.getCurrentInstance().getApplication().getDefaultLocale();
}
And for some reason getting the same MissingResourceException
.
Any help is greatly appreciated, thanks.
Select "Files" tab instead, and put the files in the folder
src -> main -> resources (create it if it's not there).
Back on the projects tab, they should turn up under
"Other sources" -> src/main/resources -> default package.
Files tab:
Projects tab:
I'd also remove the package name (or to say, I haven't tried with that).