Recent Posts

Spring: static 属性的注入必须使用非 static 的 setter

less than 1 minute read

有一些 util 类或是 config 类会用到 static 属性,这些 util 类或是 config 类也可以通过 Spring 来初始化,和初始化一个 POJO 没什么区别,虽然实际应用中不太可能去创建一个 util 对象或是 config 对象,一般都是使用 static getter 而已。

Spring: “Could not resolve placeholder” 解决方案

less than 1 minute read

除去 properites 文件路径错误、拼写错误外,出现 “Could not resolve placeholder” 很有可能是使用了多个 PropertyPlaceholderConfigurer 或者多个 <context:property-placeholder> 的原因。