zoukankan      html  css  js  c++  java
  • Spring

    2016.01.12

    学习linux内核的过程中发现变相的提升了自己的工程能力。以前觉得spring这些东西很复杂麻烦。然而,学了linux内核再看这些东西,发现好简单。

    学习spring首先就要学习自己搭建spring框架。

    首先测试初始化spring容器:

    1建立web工程

    2导包,其实myeclipse是支持spring的,直接导入myeclipse自带的spring相关libraries即可。

    3applicationContext.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-2.0.xsd">
        
    </beans>

    4建立一个test类:

    /**
    * @ClassName: FirstTest 
    * @Description: 测试实例化spring容器示例
    * @author 无名
    * @date 2016-1-12 下午2:22:25 
    * @version 1.0
     */
    public class FirstTest
    {
        @Test
        public void testInitContext(){
            String conf = "applicationContext.xml";
            ApplicationContext ac = new ClassPathXmlApplicationContext(conf);
            System.out.println(ac);
        }
    }
  • 相关阅读:
    hdu 3791 二叉搜索树
    hdu 4041 Eliminate Witches! 栈和队列
    后缀数组讲解
    Theme Section HDU
    Wow! Such Doge! HDU
    Girls' research HDU
    吉哥系列故事――完美队形II HDU
    Best Reward HDU
    String Problem HDU
    最大最小表示法
  • 原文地址:https://www.cnblogs.com/rixiang/p/5124317.html
Copyright © 2011-2022 走看看