Spring framework: No message found under code for locale

后端 未结 6 2210
遇见更好的自我
遇见更好的自我 2021-01-01 17:41

This is my messageResource declaration





        
6条回答
  •  感情败类
    2021-01-01 18:24

    In general such issue appears not because of non-existence locale, but because MessageBundle is configured improperly. In your case you seem to need to remove "/" in your basename.

    
    

    Why it is so:

    If you have messages.properties and messages_en.properties bundle, then bundle name is messages. If you have them in the WEB-INF folder, then basename is /WEB-INF/messages, i.e. according to /path/to/bundle/bundlename. If you have messages.properties within /WEB-INF/messages folder, then corresponding basename is /WEB-INF/messages/messages.

提交回复
热议问题