栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

Spring源码调试入口

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Spring源码调试入口

推荐使用【ClassPathXmlApplicationContext】作为调试入口。

大体步骤如下:

1, 创建一个spring工程,编写简单测试用例;

BeanFactory beanFactory = new ClassPathXmlApplicationContext("META-INF/bean-context.xml");
        Computer computer = beanFactory.getBean("computer", Computer.class);

2,在resources目录下创建META-INF目录,创建bean-context.xml,配置一个简单的bean;

3,找到【ClassPathXmlApplicationContext.java】源码,在如下方法中打断点;

	
	public ClassPathXmlApplicationContext(String configLocation) throws BeansException {
		this(new String[] {configLocation}, true, null);
	}

4,调试启动程序,即可进入源码调试。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/963783.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号