@ Bean public PropertiesFactoryBean casCommonMessages ( ) { val properties = new PropertiesFactoryBean ( ) ; val resourceLoader = new DefaultResourceLoader ( ) ; val commonNames = casProperties . getMessageBundle ( ) . getCommonNames ( ) ; val resourceList = commonNames . stream ( ) . map ( resourceLoader :: getResource ) . collect ( Collectors . toList ( ) ) ; resourceList . add ( resourceLoader . getResource ( "classpath:/cas_common_messages.properties" ) ) ; properties . setLocations ( resourceList . toArray ( Resource [ ] :: new ) ) ; properties . setSingleton ( true ) ; properties . setIgnoreResourceNotFound ( true ) ; return properties ; }
Load property files containing non - i18n fallback values that should be exposed to Thyme templates . keys in properties files added last will take precedence over the internal cas_common_messages . properties . Keys in regular messages bundles will override any of the common messages .