ComponentConfigurationPropertiesprefix = hostMappublic class HostMap private MapStringInteger map = new HashMap; public MapString Integer getMap return map; public void setMapMap
这是因为在使用@ConfigurationProperties注解时需要添加@Configuration或@EnableConfigurationProperties注解来启用配置属性的绑定功能。在没有这些注解的情况下,IDE会将@ConfigurationProperties注解标记为报红。
原文地址: https://www.cveoy.top/t/topic/hM4a 著作权归作者所有。请勿转载和采集!