Spring源码阅读 - 创建项目

前言

学习java已经将近一年了,经常使用Spring、SpringBoot,但在工作中经常遇到bug,不会定位、解决。因此决定阅读源码,加深对框架的理解。

创建项目

  1. 勾选(作用在下文有提到)
    在这里插入图片描述
    2.命名
    在这里插入图片描述

  2. 项目结构如下,勾选Spring的功能是下载Spring的jar包到lib中,勾选Web Application的作用是自动生成web文件夹,web.xml放一些配置,index.jsp是jsp页面。
    在这里插入图片描述

  3. 接下来我们配置spring-config.xml文件在src之下。

<?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">

    <bean id="user" class="com.learn.ioc.model.User">
        <property name="name" value="小孙"/>
        <property name="age" value="21"/>
    </bean>

</beans>
  1. 运行
    在这里插入图片描述

学习资源

参考项目
参考文档

猜你喜欢

转载自blog.csdn.net/weixin_44532671/article/details/121505710