开涛spring3(2.3) - IoC的配置使用

时间:2023-02-11 08:13:37

2.3.1  XML配置的结构

一般配置文件结构如下:

    <beans>
<import resource=”resource1.xml”/>
<bean id=”bean1”class=””></bean>
<bean id=”bean2”class=””></bean>
<bean name=”bean2”class=””></bean>
<alias alias="bean3" name="bean2"/>
<import resource=”resource2.xml”/>
</beans>

1、<bean>标签主要用来进行Bean定义;

2、alias用于定义Bean别名的;

3、 import用于导入其他配置文件的Bean定义,这是为了加载多个配置文件,当然也可以把这些配置文件构造为一个数组(new String[] {“config1.xml”, config2.xml})传给ApplicationContext实现进行加载多个配置文件,那一个更适合由用户决定;这两种方式都是通过调用 Bean Definition Reader 读取Bean定义,内部实现没有任何区别。<import>标签可以放在<beans>下的任何位置,没有顺序关系。

2.3.2  Bean的配置

Spring IoC容器目的就是管理Bean,这些Bean将根据配置文件中的Bean定义进行创建,而Bean定义在容器内部由BeanDefinition对象表示,该定义主要包含以下信息:

●全限定类名(FQN):用于定义Bean的实现类;

●Bean行为定义:这些定义了Bean在容器中的行为;包括作用域(单例、原型创建)、是否惰性初始化及生命周期等;

●Bean创建方式定义:说明是通过构造器还是工厂方法创建Bean;

●Bean之间关系定义:即对其他bean的引用,也就是依赖关系定义,这些引用bean也可以称之为同事bean 或依赖bean,也就是依赖注入。

Bean 定义只有“全限定类名”在当使用构造器或静态工厂方法进行实例化bean时是必须的,其他都是可选的定义。难道Spring只能通过配置方式来创建 Bean吗?回答当然不是,某些SingletonBeanRegistry接口实现类实现也允许将那些非BeanFactory创建的、已有的用户对象 注册到容器中,这些对象必须是共享的,比如使用DefaultListableBeanFactory 的registerSingleton() 方法。不过建议采用元数据定义。

2.3.3    Bean的命名

每个Bean可以有一个或多个id(或称之为标识符或名字),在这里我们把第一个id称为“标识符”,其余id叫做“别名”;这些id在IoC容器中必须唯一。如何为Bean指定id呢,有以下几种方式;

一、  不指定id,只配置必须的全限定类名,由IoC容器为其生成一个标识,客户端必须通过接口“T getBean(Class<T> requiredType)”获取Bean;

<bean class=” cn.javass.spring.chapter2.helloworld.HelloImpl”/>

测试代码片段如下:

@Test
public void test1() {
BeanFactory beanFactory =
new ClassPathXmlApplicationContext("chapter2/namingbean1.xml");
//根据类型获取bean
HelloApi helloApi = beanFactory.getBean(HelloApi.class);
helloApi.sayHello();
}

二、指定id,必须在Ioc容器中唯一;

<bean id=” bean” class=” cn.javass.spring.chapter2.helloworld.HelloImpl”/>
@Test
public void test2() {
BeanFactory beanFactory =
new ClassPathXmlApplicationContext("chapter2/namingbean2.xml");
//根据id获取bean
HelloApi bean = beanFactory.getBean("bean", HelloApi.class);
bean.sayHello();
}

三、指定name,这样name就是“标识符”,必须在Ioc容器中唯一;

<bean name=” bean” class=” cn.javass.spring.chapter2.helloworld.HelloImpl”/>

测试代码片段如下:

    @Test
public void test3() {
BeanFactory beanFactory =
new ClassPathXmlApplicationContext("chapter2/namingbean3.xml");
//根据name获取bean
HelloApi bean = beanFactory.getBean("bean", HelloApi.class);
bean.sayHello();
}

四、指定id和name,id就是标识符,而name就是别名,必须在Ioc容器中唯一;

<bean id=”bean1”name=”alias1”
class=” cn.javass.spring.chapter2.helloworld.HelloImpl”/>
<!-- 如果id和name一样,IoC容器能检测到,并消除冲突 -->
<bean id="bean3" name="bean3" class="cn.javass.spring.chapter2.helloworld.HelloImpl"/>

测试代码片段如下:

@Test
public void test4() {
BeanFactory beanFactory =
new ClassPathXmlApplicationContext("chapter2/namingbean4.xml");
//根据id获取bean
HelloApi bean1 = beanFactory.getBean("bean1", HelloApi.class);
bean1.sayHello();
//根据别名获取bean
HelloApi bean2 = beanFactory.getBean("alias1", HelloApi.class);
bean2.sayHello();
//根据id获取bean
HelloApi bean3 = beanFactory.getBean("bean3", HelloApi.class);
bean3.sayHello();
String[] bean3Alias = beanFactory.getAliases("bean3");
//因此别名不能和id一样,如果一样则由IoC容器负责消除冲突
Assert.assertEquals(0, bean3Alias.length);
}

五、指定多个name,多个name用“,”、“;”、“ ”分割,第一个被用作标识符,其他的(alias1、alias2、alias3)是别名,所有标识符也必须在Ioc容器中唯一;

<bean name=” bean1;alias11,alias12;alias13 alias14”
class=” cn.javass.spring.chapter2.helloworld.HelloImpl”/>
<!-- 当指定id时,name指定的标识符全部为别名 -->
<bean id="bean2" name="alias21;alias22"
class="cn.javass.spring.chapter2.helloworld.HelloImpl"/>
@Test
public void test5() {
BeanFactory beanFactory =
new ClassPathXmlApplicationContext("chapter2/namingbean5.xml");
//1根据id获取bean
HelloApi bean1 = beanFactory.getBean("bean1", HelloApi.class);
bean1.sayHello();
//2根据别名获取bean
HelloApi alias11 = beanFactory.getBean("alias11", HelloApi.class);
alias11.sayHello();
//3验证确实是四个别名
String[] bean1Alias = beanFactory.getAliases("bean1");
System.out.println("=======namingbean5.xml bean1 别名========");
for(String alias : bean1Alias) {
System.out.println(alias);
}
Assert.assertEquals(4, bean1Alias.length);
//根据id获取bean
HelloApi bean2 = beanFactory.getBean("bean2", HelloApi.class);
bean2.sayHello();
//2根据别名获取bean
HelloApi alias21 = beanFactory.getBean("alias21", HelloApi.class);
alias21.sayHello();
//验证确实是两个别名
String[] bean2Alias = beanFactory.getAliases("bean2");
System.out.println("=======namingbean5.xml bean2 别名========");
for(String alias : bean2Alias) {
System.out.println(alias);
}
Assert.assertEquals(2, bean2Alias.length);
}

六、使用<alias>标签指定别名,别名也必须在IoC容器中唯一

<bean name="bean" class="cn.javass.spring.chapter2.helloworld.HelloImpl"/>
<alias alias="alias1" name="bean"/>
<alias alias="alias2" name="bean"/>

测试代码片段如下:

@Test
public void test6() {
BeanFactory beanFactory =
new ClassPathXmlApplicationContext("chapter2/namingbean6.xml");
//根据id获取bean
HelloApi bean = beanFactory.getBean("bean", HelloApi.class);
bean.sayHello();
//根据别名获取bean
HelloApi alias1 = beanFactory.getBean("alias1", HelloApi.class);
alias1.sayHello();
HelloApi alias2 = beanFactory.getBean("alias2", HelloApi.class);
alias2.sayHello();
String[] beanAlias = beanFactory.getAliases("bean");
System.out.println("=======namingbean6.xml bean 别名========");
for(String alias : beanAlias) {
System.out.println(alias);
}
System.out.println("=======namingbean6.xml bean 别名========");
Assert.assertEquals(2, beanAlias.length);
}

从 定义来看,name或id如果指定它们中的一个时都作为“标识符”,那为什么还要有id和name同时存在呢?这是因为当使用基于XML的配置元数据时, 在XML中id是一个真正的XML id属性,因此当其他的定义来引用这个id时就体现出id的好处了,可以利用XML解析器来验证引用的这个id是否存在,从而更早的发现是否引用了一个不 存在的bean,而使用name,则可能要在真正使用bean时才能发现引用一个不存在的bean。

Bean命名约定:Bean的命名遵循XML命名规范,但最好符合Java命名规范,由“字母、数字、下划线组成“,而且应该养成一个良好的命名习惯, 比如采用“驼峰式”,即第一个单词首字母开始,从第二个单词开始首字母大写开始,这样可以增加可读性。

2.3.4  实例化Bean

Spring IoC容器如何实例化Bean呢?传统应用程序可以通过new和反射方式进行实例化Bean。而Spring IoC容器则需要根据Bean定义里的配置元数据使用反射机制来创建Bean。在Spring IoC容器中根据Bean定义创建Bean主要有以下几种方式:

一、使用构造器实例化Bean:这是最简单的方式,Spring IoC容器即能使用默认空构造器也能使用有参数构造器两种方式创建Bean,如以下方式指定要创建的Bean类型:

1.使用空构造器进行定义,使用此种方式,class属性指定的类必须有空构造器

    <bean name="bean1" class="cn.javass.spring.chapter2.HelloImpl2"/>  

2.使用有参数构造器进行定义,使用此中方式,可以使用< constructor-arg >标签指定构造器参数值,其中index表示位置,value表示常量值,也可以指定引用,指定引用使用ref来引用另一个Bean定义,后边会详细介绍:

<bean name="bean2" class="cn.javass.spring.chapter2.HelloImpl2">
<!-- 指定构造器参数 -->
<constructor-arg index="0" value="Hello Spring!"/>
</bean>

知道如何配置了,让我们做个例子的例子来实践一下吧:

(1)准备Bean class(HelloImpl2.java),该类有一个空构造器和一个有参构造器:

package lqy.springh;

public class HelloApi {

    private String message; 

    public HelloApi() {
this.message = "Hello World!";
} public HelloApi(String message) {
this.message=message;
} public void sayHello() {
System.out.println(message);
} }

(2)在配置文件配置Bean定义,如下所示

<?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:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- id 表示你这个组件的名字,class表示组件类 --> <bean id="bean1" class="lqy.springh.HelloApi"></bean> <bean id="bean2" class="lqy.springh.HelloApi">
<constructor-arg index="0" value="Hello Spring constructor-arg!"/>
</bean> </beans>

(2)测试代码

package lqy.springh;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext; /**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
//ApplicationContext context = new ClassPathXmlApplicationContext("helloworld.xml");
//使用构造器
BeanFactory beanFactory = new ClassPathXmlApplicationContext("helloworld.xml");
HelloApi bean1 = beanFactory.getBean("bean1", HelloApi.class);
bean1.sayHello();
HelloApi bean2 = beanFactory.getBean("bean2", HelloApi.class);
bean2.sayHello(); }
}

结果

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAk0AAAC/CAIAAABsXX80AAAgAElEQVR4nO2da5Ac1ZXnK2J2YmNtj/eLY2P9ZXYidiJGSBt+d68obBiHGXZQrGWLHUsyxlbRaifINsggEOMxDGDsbknmkRgjhDGSsJEt02hoSTjXjAwGo8EIZlqSpWZYV/AKzEOAIEGoVd2t7rsfsirzPs65j8ysqqzs84sKaGXlfZ37+N97s/KeSkgQBEEQ5aWCfTE+Pr6VIIgiMQd75RwsMpE7gM7FDaud+lpQ5mzBjZBlukvcK9lcIh6nxsfHu10D3ac0fbDzBZF1LupOncxBcZizBTdClukuUa/stuh0ExK8mNJ0xk4WRNA5EjlChSzTXaJeOUvMzs7OzpLahSXqkh0rSKJzksht3VTb6i/fuqm2ddOFW7f+/fat67Zv37R9dPv20V8xxkYfPjD68NOdyW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Kh+efjw4jpHjcz2HGdYKux1DvgaSQDWpGZZ5LzCOqeUyJR5bZxurh64KQ6y6tUoN+kcQRDFoqh+eQTiRUs7dA4e1ZFsZNI5rjS82hVP5wC4hETTqcGt7UkQBNEJiuqXR44j3g/kHwLp9wPVLEFS0fJcbpkP631LXOeUi6pYaddJvP8G9BelcpzOLo3UDHNbnRrLa+w5h35bRBBEgSiqXx7x6SD0C4cUfnmM6zlgVxGPVs2U8MsYJSEhS8hvc3TyE99V9X1pXQvEqsRp7dIIJg7Np25az6lZIp0jCKLT9NZ5KG14wCMuUE2/RCFMkD0JgigYpHOe+Dt5+qVENsieBEEUjDmvc+J2Ii0+MkP2JAiiWPSWzhEEQRCEG6RzBEEQRJkhnSMIgiDKDOkcQRAEUWZI5wiCIIgyQzpHEARBlBnSOYIgCKLMkM4RBEEQZYZ0jiAIgigzpHMEQRBEmSGdIwiCIMoM6RxBEARRZkjnCIIgiDJDOkcQBEGUGdI5giAIosyQzhEEQRBlhnSOIAiCKDOkcwRBEESZIZ0jCIIgygzpHEEQBFFmSOcIgiCIMkM6RxAEQZQZ0jmCIAiizJDOEQRBEGWGdI4gCIIoM/8fovgP2sGJTgwAAAAASUVORK5CYII=" alt="" />

二、 使用静态工厂方式实例化Bean,使用这种方式除了指定必须的class属性,还要指定factory-method属性来指定实例化Bean的方法,而 且使用静态工厂方法也允许指定方法参数,spring IoC容器将调用此属性指定的方法来获取Bean,配置如下所示:

(1)先来看看静态工厂类代码吧HelloApiStaticFactory:

package lqy.springh;

public class HelloApiStaticFactory {
//工厂方法
public static HelloApi newInstance(String message) {
//返回需要的Bean实例
return new HelloApi(message);
}
}

(2)静态工厂写完了,让我们在配置文件配置Bean定义

 <!-- 使用静态工厂方法 -->
<bean id="bean3" class="lqy.springh.HelloApiStaticFactory" factory-method="newInstance">
<constructor-arg index="0" value="Hello Spring!"/>
</bean>

(3)配置完了,写段测试代码来测试一下吧,InstantiatingBeanTest:

         BeanFactory beanFactory =  new ClassPathXmlApplicationContext("helloworld.xml");
HelloApi bean3 = beanFactory.getBean("bean3", HelloApi.class);
bean3.sayHello();

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAN8AAACgCAIAAAAD7y5vAAAVJklEQVR4nO1cXWwc13WeZ7n1Ux6al6JA+8An1z9Ztt7YVoOmaUWgaiTUNmuk1VZhxiriIFboqEktw1IkcUkXqccxREtxTbGuFbBZq6XkdGCDdiJXgirFwXppiYnqhSQbhCnR+uFItKT94e7tw+zO3J9zZ+7szOzOcs+HediduT/nnPvNuXfmnjkaIcSyLMuyJicnrSYmEYgEQAPZiUAkAchORHKB7EQkF0rsnJub6+z6A9Gb8GGnw8s47oyEo2cV90XbLOPFTpuabRAigehZxX3RTstI2YnURIhos2VgdnLUnNyXmTQGJ/dlJvdtmZz83tTk6NTUvqnpqanpNwkh00cL00fPtlPoWEErfuS5u8Gjc9J1Eu2/adXYaQwWrBIh5FKpRB+EkJnjc/bv6aMftVn0mEAr/l+j95QrK9xx5sg/9CZBk8JOTo59RsZm58ez78+N7Xpvw7q5sV0fz75PCJk5fuZSqbS4WgjKKf569l6RnR++s32u9wgqo+bsoe87R+SdKrHTGM0UrFKdkLmx3Z888fjys9s/eeLxubHdNVKfOXZmsVz6tFyOgZ35bL+WyYnncxnwdBTgFJ8aue92ecU++jaP3y6vlMrVj04+/+E7288c2fIfe+6LRwobkaqZz/Zr/dl86w2A7Cy8/n1CofD691rvAIIiO7cUrNJKnby3Yd3S2g3X125cWrvhvT9fu1Kvzxw7c7lcvlIuXyqVpgB25rP9moOAxu48O1/b9YWbt6s3b1f7No/bP26WqrdK1Zul6s1S9eDuL8hbYhQPrLplJZmde3eO7d05tnfnaGVxorI4cevC+JXZf55/95n/O7J1785R9hgDRVG0ixI7R3dsKVilSq12dsP6+UcHrU36/KODZzesr9brM8fnrpYr1yqVqTfBB6N8tr9plMAG6jw7D/wgtXyrunyr2rd53P6xfLO6fLNq/z78/IPylljhc5ngDA2vpsyArYC2zNjTP9zzwkly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Vq4fOqhdg0zxQR/I9d2bgQBInKwed8n6uSnI2r2A8yc4vEDwm1hU68skVEzDEhN93VmdnuKx6sO7hOxKzI0EDJ6qZvBx0kj0JkZ2BP2lQz0rFBY+JdQkzGP5Z4NTpJbYZqHq4rHqNZnSBoyE7EmJn4YELz05CYs5Bp8zOwJvFQdgpnuRiFIJmgQuYco1qU7k62HuArHp0w8GTS3p1BC0MZCGIEiMnJAedOjvZOcJrDFrNmQYv5IXnEpUscIop18CseqrVw2XVg3UP2ZFETdnAiUbGHHSrGW3LqhdzRwl5G4+IFG3LqhdzR8jOVYm2ZdWLtyNkJyK5QHYikgtkJyK5iJ6dpq7ZoN/sgifbiqKRDtN70UhracyK3GYo7hXp1NAUjbTvMINlVCp6tKeFIjiyswvRDexMBDNMvXN+v2cRjp2US2OHTo2d0upiPZGdpq7pRrMB5zJzttkqtK6Aq7tFufPIzk5AmZ0sdJOwA8bwV4mdNOf8vGODxkwRU3foRlU3dbcYSyhOJKq6qVO/qMp8d8jOdiOE76TXgjx3/NkpksV38FmO0jXcxuTtyDtkaiM7E4QQ7OTHj0Ys7GwWFD13VOykJ4mOr3QRodad7owoIOKZnW3DLknRixIkFDuLRlomRSKezHoOkT0VNQvw831z2MWTtKfyHHh21UtTUqwOsRPs3dd3sg9RyM5OoHv3imJYCLKTgdfKBdEWIDvZJpm3EPgc1GEgO2kwawB0nB1H97ITsfqB7EQkF8hORHKB7EQkF8hORHKB7EQkF/8PoyYQT6i8Ul4AAAAASUVORK5CYII=" alt="" />

三、 使用实例工厂方法实例化Bean,使用这种方式不能指定class属性,此时必须使用factory-bean属性来指定工厂Bean,factory- method属性指定实例化Bean的方法,而且使用实例工厂方法允许指定方法参数,方式和使用构造器方式一样,配置如下:

(1)实例工厂类代码(HelloApiInstanceFactory.java)如下:

package lqy.springh;

public class HelloApiInstanceFactory {
public HelloApi newInstance(String message) {
return new HelloApi(message);
}
}

(2)让我们在配置文件配置Bean定义:

<?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:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <!-- 1、定义实例工厂Bean -->
<bean id="beanInstanceFactory"
class="lqy.springh.HelloApiInstanceFactory"/>
<!-- 2、使用实例工厂Bean创建Bean -->
<bean id="bean4" factory-bean="beanInstanceFactory" factory-method="newInstance">
<constructor-arg index="0" value="Hello Spring!"></constructor-arg>
</bean> </beans>

(3)测试代码

         BeanFactory beanFactory =  new ClassPathXmlApplicationContext("helloworld.xml");
HelloApi bean3 = beanFactory.getBean("bean4", HelloApi.class);
bean3.sayHello();

通过以上例子我们已经基本掌握了如何实例化Bean了,大家是否注意到?这三种方式只是配置不一样,从获取方式看完全一样,没有任何不同。这也是Spring IoC的魅力,Spring IoC帮你创建Bean,我们只管使用就可以了,是不是很简单。

2.3.5  小结

到此我们已经讲完了Spring IoC基础部分,包括IoC容器概念,如何实例化容器,Bean配置、命名及实例化,Bean获取等等。不知大家是否注意到到目前为止,我们只能通过简单 的实例化Bean,没有涉及Bean之间关系。接下来一章让我们进入配置Bean之间关系章节,也就是依赖注入。

开涛spring3(2.3) - IoC的配置使用的更多相关文章

  1. 开涛spring3&lpar;2&period;1&rpar; - IoC基础

    2.1.1  IoC是什么 Ioc—Inversion of Control,即“控制反转”,不是什么技术,而是一种设计思想.在Java开发中,Ioc意味着将你设计好的对象交给容器控制,而不是传统的在 ...

  2. 开涛spring3&lpar;3&period;1&rpar; - DI的配置使用

    3.1.1  依赖和依赖注入 传统应用程序设计中所说的依赖一般指“类之间的关系”,那先让我们复习一下类之间的关系: 泛化:表示类与类之间的继承关系.接口与接口之间的继承关系: 实现:表示类对接口的实现 ...

  3. 开涛spring3&lpar;2&period;2&rpar; - IoC 容器基本原理及其helloword

    2.2.1  IoC容器的概念 IoC容器就是具有依赖注入功能的容器,IoC容器负责实例化.定位.配置应用程序中的对象及建立这些对象间的依赖.应用程序无需直接在代码中new相关的对象,应用程序由IoC ...

  4. 开涛spring3&lpar;12&period;4&rpar; - 零配置 之 12&period;4 基于Java类定义Bean配置元数据

    12.4  基于Java类定义Bean配置元数据 12.4.1  概述 基于Java类定义Bean配置元数据,其实就是通过Java类定义Spring配置元数据,且直接消除XML配置文件. 基于Java ...

  5. 开涛spring3&lpar;12&period;3&rpar; - 零配置 之 12&period;3 注解实现Bean定义

    12.3  注解实现Bean定义 12.3.1  概述 前边介绍的Bean定义全是基于XML方式定义配置元数据,且在[12.2注解实现Bean依赖注入]一节中介绍了通过注解来减少配置数量,但并没有完全 ...

  6. 开涛spring3&lpar;12&period;2&rpar; - 零配置 之 12&period;2 注解实现Bean依赖注入

    12.2  注解实现Bean依赖注入 12.2.1  概述 注解实现Bean配置主要用来进行如依赖注入.生命周期回调方法定义等,不能消除XML文件中的Bean元数据定义,且基于XML配置中的依赖注入的 ...

  7. 开涛spring3&lpar;12&period;1&rpar; - 零配置 之 12&period;1 概述

    12.1  概述 12.1.1  什么是零配置 在SSH集成一章中大家注意到项目结构和包结构是不是很有规律,类库放到WEB-INF/lib文件夹下,jsp文件放到WEB-INF/jsp文件夹下,web ...

  8. 开涛spring3&lpar;1&rpar; - Spring概述

    1.1.1  Spring是什么 Spring是一个开源的轻量级Java SE(Java 标准版本)/Java EE(Java 企业版本)开发应用框架,其目的是用于简化企业级应用程序开发.应用程序是由 ...

  9. 开涛spring3&lpar;9&period;2&rpar; - Spring的事务 之 9&period;2 数据库事务概述

    9.2.1  概述 Spring框架支持事务管理的核心是事务管理器抽象,对于不同的数据访问框架(如Hibernate)通过实现策略接口 PlatformTransactionManager,从而能支持 ...

随机推荐

  1. iOS开发UI篇—直接使用UITableView Controller

    iOS开发UI篇—直接使用UITableView Controller 一.一般过程 // // YYViewController.h // UITableView Controller // // ...

  2. 基于SourceTree 下的 Git Flow 模型

    基于SourceTree 下的 Git Flow 模型 1. sourceTree  是一个开源的git 图形管理工具,可下载mac版本,windows版本 2. Git Flow 是一套使用Git进 ...

  3. B - Fill

    Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Status Practice UV ...

  4. 求教。。 为什么加载到servlet页面显示空白或者一直加载页面没显示也没错误?

    package com.bean; public class Example7_2_Bean { String[] columnName;// 存放列名 String[][] tableRecord ...

  5. Spring 中拦截器与过滤器的区别

    spring 中拦截器 与servlet 的filter 有相似之处.比如二者都是aop 编程思想的体现都能实现权限检查,日志记录等. 不同之处 使用范围不同 Filter 是Servlet 规定的. ...

  6. 解决ssm项目表单数据提交到数据库乱码问题

    问题:在ssm整合的项目里,从前台页面获取表单数据存到数据库中乱码 先说解决办法然后分析:问题出在form表单的提交方式上,我的web.xml配置过滤器都已经指定了编码集,为什么没有生效?原因是,对于 ...

  7. appium-基础搭建,适配,问题,优化,提速

    搭建开发环境,导入testng/log4j/maven 1.配置jdk环境 2.安装appium,下载eclipse-adt,配置appium环境 github.com/get*/foru ...

  8. Codechef FIBTREE 树链剖分 主席树 LCA 二次剩余 快速幂

    原文链接https://www.cnblogs.com/zhouzhendong/p/CC-FIBTREE.html 题目传送门 - CC-FIBTREE 题意 给定一个有 $n$ 个节点,初始点权都 ...

  9. 【转载】&period;NET&sol;C&num;-uploadify视频文件or大文件上传

    引言 之前使用Uploadify做了一个上传图片并预览的功能,今天在项目中,要使用该插件上传大文件.之前弄过上传图片的demo,就使用该demo进行测试.可以查看我的这篇文章: [Asp.net]Up ...

  10. 从零开始的Python学习Episode 22——多线程

    多线程 线程 线程是操作系统能够进行运算调度的最小单位.它被包含在进程之中,是进程中的实际运作单位.一条线程指的是进程中一个单一顺序的控制流,一个进程中可以并发多个线程,每条线程并行执行不同的任务. ...