From 66e9c6c4a38b8b0c4d05ae161a58919abbe3ea90 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Fri, 30 Sep 2022 07:21:02 -0400 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=A6=82=E4=BD=95=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E4=B8=80=E4=B8=AA=20Spring=20Security=20=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- servlet/getting-started.md | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/servlet/getting-started.md b/servlet/getting-started.md index 502ba28..f4f0556 100644 --- a/servlet/getting-started.md +++ b/servlet/getting-started.md @@ -2,38 +2,30 @@ 本节介绍了如何把 Spring Security 与 Spring Boot 结合使用的最小设置。 -?> The completed application can be found {gh-samples-url}/servlet/spring-boot/java/hello-security[in our samples repository]. -For your convenience, you can download a minimal Spring Boot + Spring Security application by https://start.spring.io/starter.zip?type=maven-project&language=java&packaging=jar&jvmVersion=1.8&groupId=example&artifactId=hello-security&name=hello-security&description=Hello%20Security&packageName=example.hello-security&dependencies=web,security[clicking here]. +?> 完整的本示例程序可以在 https://github.com/spring-projects/spring-security-samples/tree/5.7.x/servlet/spring-boot/java/hello-security 仓库中找到。 +为了方便您的使用和测试,你可以 [单击这里](https://start.spring.io/starter.zip?type=maven-project&language=java&packaging=jar&jvmVersion=1.8&groupId=example&artifactId=hello-security&name=hello-security&description=Hello%20Security&packageName=example.hello-security&dependencies=web,security) +下载 zip 的版本直接解压后运行。 -[[servlet-hello-dependencies]] ## 更新依赖 -The only step you need to do is update the dependencies by using xref:getting-spring-security.adoc#getting-maven-boot[Maven] or xref:getting-spring-security.adoc#getting-gradle-boot[Gradle]. +针对已经下载下来的版本,唯一需要做的就是更新 [Maven](getting-spring-security.md#getting-maven-boot) 或者 [Gradle](getting-spring-security.md#getting-gradle-boot) 依赖。 -[[servlet-hello-starting]] -== Starting Hello Spring Security Boot -You can now https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-running-with-the-maven-plugin[run the Spring Boot application] by using the Maven Plugin's `run` goal. -The following example shows how to do so (and the beginning of the output from doing so): +## 启动 Hello Spring Security Boot 应用 -.Running Spring Boot Application -==== -[source,bash] ----- +现在,你可以使用 Maven 的插件 `run` [运行 Spring Boot 应用](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-running-with-the-maven-plugin)。 +下面的代码显示了使用这个插件如何启动这个应用(以及执行本操作的控制台输出): + +```shell $ ./mvn spring-boot:run ... INFO 23689 --- [ restartedMain] .s.s.UserDetailsServiceAutoConfiguration : Using generated security password: 8e557245-73e2-4286-969a-ff57fe326336 +``` -... ----- -==== - - -[[servlet-hello-auto-configuration]] -== Spring Boot Auto Configuration +## Spring Boot 自动配置 // FIXME: Link to relevant portions of documentation // FIXME: Link to Spring Boot's Security Auto configuration classes