您的位置:首页 > 编程语言 > Java开发

spring简单示例

2016-02-17 11:14 453 查看
1 配置config.xml

package com.gc.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import com.gc.action.HelloWorld;
public class TestHelloWorld {
public static void main(String[] args) {
@SuppressWarnings("resource")
ApplicationContext actx = new FileSystemXmlApplicationContext("config.xml");
HelloWorld hello=(HelloWorld)actx.getBean("HelloWorld");
System.out.println(hello.getMsg());
}
}


View Code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: