zoukankan      html  css  js  c++  java
  • Spring核心概念

    依赖

    <!-- https://mvnrepository.com/artifact/org.springframework/spring-beans -->
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
          <version>5.1.5.RELEASE</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
          <version>5.1.5.RELEASE</version>
        </dependency>

    小配置

    <?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相当于当前bean唯一标识
            class是bean 的全路径
            property注入bean中的属性         必须封装
        -->
        <bean id="studentBean" class="cn.spring.entity.StudentBean">
            <property name="stu_id" value="18"></property>
            <property name="stu_name" value="王洪涛"></property>
        </bean>
    </beans>

     

     <?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相当于当前bean唯一标识
            class是bean 的全路径
            property注入bean中的属性         必须封装
        -->
        <bean id="studentBean" class="cn.spring.entity.StudentBean">
            <property name="stu_id" value="18"></property>
            <property name="stu_name" value="王洪涛"></property>
        </bean>
    </beans>

     

     

     

     

     

     

     

  • 相关阅读:
    CCCC L2-023. 图着色问题【set去重判不同种类个数/简单图论/判断两相邻点是否存在同色以及颜色个数】
    百练 04 简单的整数划分问题
    NYOJ90 整数划分(经典递归和dp)
    图遍历问题
    图着色问题
    Java 大数(整数+浮点数) 基本函数
    根据规律绘制图形(俗称蛇皮走位)
    KMP算法之我见
    CCCC L1-039. 古风排版【图形输出/循环控制行列/模拟/细节】
    HYSBZ 2818 Gcd【欧拉函数/莫比乌斯】
  • 原文地址:https://www.cnblogs.com/wang01/p/11737725.html
Copyright © 2011-2022 走看看