<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
添加红色部分
<bean id="some1" class="com.langzixin.spring.Some">
<property name="name" value="Fuck"/>
</bean>
<bean id="some2" class="com.langzixin.spring.Some">
<property name="name" value="Hell"/>
</bean>
<util:list id="strArray"> <!--字符串数组-->
<value>Fuck</value>
<value>Welcome</value>
</util:list>
<util:list id="objArray"><!--对象数组-->
<ref bean="some1"/>
<ref bean="some2"/>
</util:list>
<util:list id="list" list-class="java.util.ArrayList"><!--List-->
<value>ListTest</value>
<ref bean="some1"/>
<ref bean="some2"/>
</util:list>
<util:map id="map" map-class="java.util.HashMap"><!--Map-->
<entry key="MapTest" value="FuckWorld"/>
<entry key="someKey" value-ref="some1"/>
</util:map>
<bean id="someBean02" class="com.langzixin.spring.SomeBean02">
<property name="someStrArray" ref="strArray"/>
<property name="someObjArray" ref="objArray"/>
<property name="someList" ref="list"/>
<property name="someMap" ref="map"/>
</bean>
配置Bean即可
分享到:
相关推荐
自定义依赖注入工具类SpringUtil.java
SpringUtil工具类(获取applicationContext,通过name获取 Bean,通过class获取Bean,通过name,以及Clazz返回)
NULL 博文链接:https://summerbell.iteye.com/blog/364702
META-INF/MANIFEST.MF META-INF/license.txt org.springframework.remoting.caucho.BurlapClientInterceptor.class org.springframework....org/springframework/web/util/HtmlCharacterEntityReferences.properties
spring约束文件,4.0版本,spring-aop-4.0.xsd、spring-beans-4.0.xsd、spring-context-4.0.xsd、spring-mvc-4.0.xsd、spring-tool-4.0.xsd、spring-tx-4.0.xsd、spring-util-4.0.xsd
2、采用Jsp->Action->Service->Dao的编码方式,封装了HibernateUtil、SpringUtil、HqlUtil等工具,以及简化了增删查改操作。 3、此底层包含泛型DAO、Proxool连接池、国际化语言、DateUtil工具、ExcelUtil报表工具、...
Spring框架依赖jar包,其中最小依赖包:org.springframework.core、org.springframework.context、org.springframework.beans、org.springframework.asm、org.springframework.expression、...
Java项目开发常用工具包,其中主要包括:Assert.java BufferedImageLuminanceSource.java CipherUtil.java ClientConst.java ...SpringUtil.java UUIDUtils.java WriteBitMatricToFile.java XmlUtil.java
SpringBoot2.1.0与Dubbo2.6.5基于properties文件的整合--Maven项目工程
主要介绍了Spring实战之使用util:命名空间简化配置操作,结合实例形式分析了Spring使用util:命名空间简化配置操作的具体步骤与相关操作注意事项,需要的朋友可以参考下
压缩包内含有该文件所对应的URI,当开发环境没有网络或者远程获取速度过慢时能用到,希望能帮助到有需要的同学。
heartbeatService = SpringUtil.getBean(HeartbeatServiceImpl.class); return heartbeatService.setOutDate(token); }else { response.sendRedirect(serverConfig.SERVER + "loginInfo/login11"); return true...
spring2.5基于注解的例子程序,包含相关jar包
spring-aop、spring-beans、spring-cache、spring-context、spring-jdbc、spring-jee、spring-jms、spring-lang、spring-mvc、spring-oxm、spring-task、spring-tool、spring-tx、spring-util、spring-websocket、
spring-1 演示了使用setter方式及构造器方式创建bean,util:list标签创建集合,p标签简化配置 和依赖注入, 以及bean的autowire和继承与依赖,以及bean的作用域。 spring-2 演示了外部配置文件的引入(connection)...
本类封装了Spring提供的HibernateTemplate,从提供了对数据的各种操作,因此,本类尤其适合用Spring + Hibernate整合后进行系统开 发时使用。 AnyFoAction功能概述 AnyFoDao中的那个类,提供多个方法来对...
spring-aop.xsd; spring-beans.xsd; spring-cache.xsd; spring-context.xsd; spring-jdbc.xsd; spring-jee.xsd;...spring-jms.xsd;...spring-lang.xsd;...spring-util.xsd; spring-websocket.xsd
spring全套xsd文件,放入xml catalog中后,会自动自动提示spring标签
其中包含了spring3.2.0的相关jar包,还有xml中自动提示的本地xsd文件。