cannot resolve spring message code using messageSource

前端 未结 4 808
终归单人心
终归单人心 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:34

    I use following bean and it is working fine without specifying the path to the file:

    
        
    
    

    Although the files I use are simply called "messages_en.properties" and "messages_es.properties" well you get the idea.

    When you call

        messageSource.getMessage("validation_required", null, null);
    

    do you get an exception? Try to use this file name messages_en.properties or messages_us_en.properties

提交回复
热议问题