ResourceBundle [messages] not found for MessageSource: Can't find bundle for base name messages

孤人 提交于 2019-12-06 08:07:14
AndreaNobili

You probably only have to add the resource folder to the classpath of your project.

Try to do the following operation:

Right click on the project name in the Package Explorer view ---> Properties ---> Java Build Path ---> stay in the Source tab (opened by default) ---> click on Folder ---> the list of all the folders inside your project should now appear ---> tick on the folder that contains the message properties file

Rebuild the project and try to run.

ROROROOROROR

Although it has been 2 years since the question asked, but I've got the same problem and found a solution.

If you want to keep your i18n properties file somewhere outside the webcontent folder, you should modify the file org.eclipse.resources.prefs in the .setting folder. and do like this:

eclipse.preferences.version=1
encoding//WebContent/WEB-INF/i18n/property_en.properties=UTF-8
encoding//WebContent/WEB-INF/i18n/property_fr.properties=UTF-8

In the bean property, set the messageSource like you did before. but add :

<property name="defaultEncoding" value="UTF-8" />

Hope it works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!