Spring source code reading - create a project

foreword

I have been learning java for nearly a year. I often use Spring and SpringBoot, but I often encounter bugs at work, and I can’t locate and solve them. So I decided to read the source code to deepen my understanding of the framework.

create project

  1. Check it (the function is mentioned below)
    insert image description here
    2. Naming
    insert image description here

  2. The project structure is as follows, the function of checking Spring is to download the Spring jar package to lib, the function of checking Web Application is to automatically generate a web folder, put some configuration in web.xml, and index.jsp is a jsp page.
    insert image description here

  3. Next we configure the spring-config.xml file under 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. run
    insert image description here

Learning Resources

Reference Project
Reference Documentation

Supongo que te gusta

Origin blog.csdn.net/weixin_44532671/article/details/121505710
Recomendado
Clasificación