Spring

目录

 

Spring一些基础

其他问题

web.xml的生成:

Spring的配置文件:

运行程序两种方法

1. main 

2. Junit

   (1) @Test 时报错,解决方法:

    (2)代码出错,解决办法:导入jar包


Spring一些基础

Spring:

为了方便管理各个功能之间的依赖关系而形成的一个框架。

Spring核心功能:

IOC:控制反转,即控制对象之间的关系。

AOP

Spring容器: 

之前创建的类,使用时要通过new创建对象来使用,而现在可以通过框架来使用。


 其他问题

web.xml的生成:

  •  

Spring的配置文件:

  •  

运行程序两种方法

1. main 

package s01;

import java.util.Date;

public class C {

	
	public static void main(String[] args) {
		Date date = new Date();
		System.out.print(date);

	}

}

2. Junit

package test;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo {
	@Test
	public void Test02() {
		
		ApplicationContext ac = new ClassPathXmlApplicationContext();
		
	}

}

@Test 时报错,解决方法:

1.

2.

 

代码出错,解决办法:导入jar包

ApplicationContext ac = new ClassPathXmlApplicationContext();

                导入jar包

BuildPath ---> Add to BuildPath

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值