首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

spring中配备bean及引用

2012-08-16 
spring中配置bean及引用  spring 中配置一个list类型的bean之后,若想在类里面将其注入就不能用一般的@Inje

spring中配置bean及引用

  spring 中配置一个list类型的bean之后,若想在类里面将其注入就不能用一般的@Inject标签了,
如下:配置简单的list
   <util:list id="systemAccountListZTL" list-encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:batch="http://www.springframework.org/schema/batch"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:jms="http://www.springframework.org/schema/jms" xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.0.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">

<bean id="info" value="code" />
<property name="comments" value="请输入编号" />
<property name="required" value="true" />
<property name="type">
<value type="com.book511.service.product.ColumnInfo$Type">INPUT</value>
</property>
<property name="regex">
<null />
</property>
<property name="options">
<list>
<value>a</value>
<value>b</value>
</list>
</property>
</bean>



<util:list id="StorageAddInfos">
<bean value="进价" />
<property name="comments" value="1、必填项。2、需为有效价格格式" />
<property name="required" value="true" />
<property name="type">
<value type="com.book511.service.product.ColumnInfo$Type">INPUT</value>
</property>
<property name="regex" value="^\d+(\.\d+)?$"/>
</bean>
<bean value="入库数量" />
<property name="comments" value="1、必填项。2、只能录入正整数" />
<property name="required" value="true" />
<property name="type">
<value type="com.book511.service.product.ColumnInfo$Type">INPUT</value>
</property>
<property name="regex" value="^[0-9]*[1-9][0-9]*$"/>
</bean>
<bean value="入库原因" />
<property name="comments" value="" />
<property name="required" value="true" />
<property name="type">
<value type="com.book511.service.product.ColumnInfo$Type">RADIO</value>
</property>
<property name="regex">
<null />
</property>
<property name="options">
<list>
<value>外购</value>
<value>内调</value>
<value>赠送</value>
<value>盘盈</value>
</list>
</property>
</bean>
<bean value="供货单位" />
<property name="comments" value="" />
<property name="required" value="false" />
<property name="type">
<value type="com.book511.service.product.ColumnInfo$Type">RADIO</value>
</property>
<property name="regex">
<null />
</property>
<property name="options">
<list>
<value>人民邮电出版社</value>
<value>机械出版社</value>
</list>
</property>
</bean>
</util:list>
</beans>

    



   

热点排行