cannot resolve spring message code using messageSource

前端 未结 4 799
终归单人心
终归单人心 2021-01-06 19:11

I am trying to hook up a messageSource in spring to use for my application. Its not working, gives this error:

org.springframework.context.NoSuchMessa

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-06 19:40

    The problem is with the way you have defined the resource bundle and the locale you are specifying (They doesn't match with the resource bundle's search order. Either rename your bundle to "messages_en.properties" or invoke the "getMessage(...)" with new Locale("en","US"). I prefer the first option.

提交回复
热议问题