使用p命名空间为bean属性赋值

<bean id="person" class="cn.com.tt.Person" 
  p:name="jikoy" 
  p:age="28"
  p:cars-ref="cars">
</bean>
<?xml version = 1.0 encoding=UTF-8>

<beans 
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.springframework.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
 xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframe.org/schema/beans/spring-beans.xsd">
    
    <bean name="classic" class="com.example.ExampleBean">
      <property name="email" value="foo@bar.com"/>
  </bean>

 

posted @ 2014-12-13 09:32  jikoy chiu  阅读(186)  评论(0编辑  收藏  举报