1、p标签 p代表属性properties
(1)第一步在xml中添加约束
xmlns:p="http://www.springframework.org/schema/p"
(2)

注:写上User.class就不用强制类型转换了
2、c标签 c代表构造器construction 使用c的前提必须有有参构造
(1)第一步在xml中添加约束
xmlns:c="http://www.springframework.org/schema/c"
(2)

原文:https://www.cnblogs.com/baotianyi/p/14519794.html