Spring Tutorial – Spring 教程

最后修改: 2022年 11月 11日


The Spring Framework is a mature, powerful and highly flexible framework focused on building web applications in Java.

Spring Framework是一个成熟、强大和高度灵活的框架,专注于在Java中构建Web应用程序。

One of the core benefits of Spring is that it takes care of most of the low-level aspects of building the application to allow us to actually focus on features and business logic.


Another strong point is that, while the framework is quite mature and well-established, it’s very actively maintained and has a thriving dev community. This makes it quite up to date and aligned with the Java ecosystem right now.


Of course, there’s a lot to learn to work well with Spring.


Let’s get started.


spring on web - icon

Spring on the Web



The Spring MVC framework is the foundation of building web applications with Spring.

Spring MVC框架是用Spring构建Web应用的基础。

It powers a wide range of web applications, from traditional MVC-style applications, all the way to stateless REST APIs.

它为广泛的网络应用提供支持,从传统的MVC风格的应用,一直到无状态的REST APIs。

Let’s start with some of the basics – the common ground between all of these styles of web applications:


And then, the basics of building a traditional, MVC-style web application:


And, if you’d like to explore the Spring MVC framework more in-depth, here’s a more comprehensive guide to do that.

而且,如果你想更深入地探索Spring MVC框架,这里有一个更全面的指南,以做到这一点

Finally, let’s explore the RESTful support in Spring MVC:

最后,让我们来探索Spring MVC中的RESTful支持。

And, if you’d like to further explore building a REST API with Spring, you can go through the more full-fledged series of articles here.

而且,如果你想进一步探索用Spring构建REST API,你可以通过这里有更全面的系列文章

spring persistence - icon

Spring Persistence – SQL

Spring Persistence – SQL


Spring supports most persistence solutions out there:


spring persistence non - icon

Spring Persistence – No SQL

Spring Persistence – 无SQL

spring security - icon

Spring Security



Next, a really strong aspect of the Spring ecosystem – security: