Spring-Instantiation bean with a static factory method
来源:互联网 发布:js计时器的启动与停止 编辑:程序博客网 时间:2024/05/22 01:11
web.xml
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <!-- services --> <bean id="clientService" class="com.vv.staticfactory.sample.StaticSample" factory-method="createInstance"></beans>
StaticSample.java
package com.vv.staticfactory.sample;import org.springframework.context.ApplicationContext;import org.springframework.context.support.ClassPathXmlApplicationContext;public class StaticSample {private static StaticSample createInstance = new StaticSample();private StaticSample() {System.out.println("Instantiation constructor with static factory model");}public static StaticSample createInstance() {return createInstance;}public static void main(String[] args) {// TODO Auto-generated method stubApplicationContext context = new ClassPathXmlApplicationContext("web.xml");StaticSample sample = context.getBean("clientService", StaticSample.class);sample.createInstance();}}
outputInstantiation constructor with static factory model
- Spring-Instantiation bean with a static factory method
- Java Spring Tutorial -- Factory, Static, and Constructor Bean Instantiation
- spring factory-method和factory-bean 使用
- spring factory-method和factory-bean 使用
- spring factory-method和spring-bean
- Spring 通过工厂方法(Factory Method)来配置bean
- Spring 通过工厂方法(Factory Method)来配置bean
- Spring 通过工厂方法(Factory Method)来配置bean
- spring几种依赖注入方式以及ref-local/bean,factory-bean,factory-method区别联系
- A factory method Pattern
- Spring factory-method
- spring factory-method
- spring factory-method
- spring factory-method
- spring factory-method
- spring factory-method
- spring factory-method
- spring 作为bean factory
- Windows Gdi & CDC和HDC的区别与转换
- ostream_iterator用法,以及unique_copy函数功能测试
- 第七周项目—阅读程序
- 如何正确选择AD/DA器件
- linux的hostname修改详解
- Spring-Instantiation bean with a static factory method
- 第七周上机阅读程序
- 开始写学习笔记,Mark一下
- 第七周-第一部分
- 第七周阅读程序----改错
- #define WIN32_LEAN_AND_MEAN作用
- javaScript中URL编码转换,escape() encodeURI() encodeURIComponent
- RTX的修改经历
- 电脑使用小技巧