玩一玩Spring容器(可视化笔记02)

一、Web开发技术

从学习角度来说,理解技术问题要越透彻越好,被屏蔽或被封装起来的信息要越少越好。从工程实现角度来说,要尽量高效地使用现成框架和现成工具——这是“学习”和“工程实现”的差别,但这两件事并不矛盾,我们学习得越透彻,在工程实现时,对框架和工具的使用就越高效。

二、Spring框架

网址:https://spring.io

 目前(2022-5-27)Spring Framework版本是5.3.20

(二)Spring框架优点

  1. Spring makes Java productive.
  2. Spring makes Java reactive.
  3. Spring makes Java cloud-ready.
  4. Spring makes Java simple.
  5. Spring makes Java modern.

(三)为什么要选择Spring?

Spring makes programming Java quicker, easier, and safer for everybody. Spring’s focus on speed, simplicity, and productivity has made it the world's most popular Java framework.

“We use a lot of the tools that come with the Spring framework and reap the benefits of having a lot of the out of the box solutions, and not having to worry about writing a ton of additional code—so that really saves us some time and energy.” —— SEAN GRAHAM, APPLICATION TRANSFORMATION LEAD, DICK’S SPORTING GOODS
 

三、创建Spring应用程序 - 骑士完成任务

(一)创建Maven项目

创建Maven项目 - SpringDemo,设置项目位置以及组ID

 单击【Finish】按钮

 修改项目的Maven配置

 

(二)添加Spring依赖

在Maven仓库里查找Spring框架(https://mvnrepository.com

 选择最新版本 - 5.3.20

添加到pom.xml文件的<dependencies>元素里

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
         http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>net.huawei.spring</groupId>
    <artifactId>SpringDemo</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <!--Spring核心-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值