标签:数值 大连 vat 过程 host 种类型 depend 音乐 ebean
bean对象 ref
基本数据类型和字符串
各种类型的集合list set map Properties
public class ValueBean { private String name; private Integer age; private List<String> like; private Set<String> city; private Map<String,Object> student; private Properties db; public void setName(String name) { this.name = name; } public void setAge(Integer age) { this.age = age; } public void setLike(List<String> like) { this.like = like; } public void setCity(Set<String> city) { this.city = city; } public void setStudent(Map<String, Object> student) { this.student = student; } public void setDb(Properties db) { this.db = db; } @Override public String toString() { return "ValueBean [name=" + name + ", age=" + age + ", like=" + like + ", city=" + city + ", student=" + student + ", db=" + db + "]"; } }
<!-- 给各种类型的参数依赖注入 --> <bean id="valueBean" class="cn.tedu.spring.bean.ValueBean"> <property name="name" value="王影"/> <property name="age" value="18"/> <property name="like"> <list> <value>旅游</value> <value>电视剧</value> <value>听音乐</value> </list> </property> <property name="city"> <set> <value>沈阳市</value> <value>大连市</value> <value>鞍山市</value> </set> </property> <property name="student"> <map> <entry key="name" value="贾宝飞"/> <entry key="age" value="18"/> <entry key="phone" value="13800138000"/> </map> </property> <property name="db"> <props> <prop key="driverClassName">com.mysql.jdbc.Driver</prop> <prop key="url">jdb:mysql://localhost:3306/dbName</prop> <prop key="username">root</prop> <prop key="password">root</prop> </props> </property> </bean>
标签:数值 大连 vat 过程 host 种类型 depend 音乐 ebean
原文地址:https://www.cnblogs.com/shijinglu2018/p/9563411.html