Selaa lähdekoodia

Polish up Spring Boot guide

Greg Turnquist 13 vuotta sitten
vanhempi
commit
f32b3175fb
2 muutettua tiedostoa jossa 32 lisäystä ja 14 poistoa
  1. 16
    7
      README.ftl.md
  2. 16
    7
      README.md

+ 16
- 7
README.ftl.md Näytä tiedosto

@@ -131,7 +131,7 @@ Add this to your build file's list of dependencies:
131 131
 
132 132
 Adding multipart upload support
133 133
 -------------------------------
134
-You should also update your configuration and add a `MultipartConfigElement` to the application context.
134
+Imagine you also want to add file upload support. To do that, update your configuration and add a `MultipartConfigElement` to the application context.
135 135
 
136 136
     <@snippet path="src/main/java/hello/Application.java" prefix="complete"/>
137 137
     
@@ -193,11 +193,11 @@ There is little change from the previous output, except there is no longer a `to
193 193
 
194 194
 There is also the `multipartConfigElement` you added. But along with it came a `multipartResolver` [courtesy of Spring Boot](https://github.com/SpringSource/spring-boot/blob/master/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/MultipartAutoConfiguration.java), a bean recommended to support file uploads with Spring MVC.
195 195
 
196
-Other than that, everything else appears the same, as it should be. Most the beans listed above provide Spring MVC's production-grade features. Just swapping one aspect, the container, and adding upload support shouldn't cause a system wide ripple.
196
+Other than that, everything else appears the same, as it should be. Most the beans listed above provide Spring MVC's production-grade features. Just swapping one part, the servlet container, and adding upload support shouldn't cause a system wide ripple.
197 197
 
198 198
 Adding consumer-grade services
199 199
 ------------------------------
200
-If you are building a web site for your business, there are probably some management services you are thinking about adding. Spring Boot provides several out of the box with it's [actuator module][spring-boot-actuator] like health, audits, beans, and more.
200
+If you are building a web site for your business, there are probably some management services you are thinking about adding. Spring Boot provides several out of the box with its [actuator module][spring-boot-actuator] like health, audits, beans, and more.
201 201
 
202 202
 Add this to your pom.xml:
203 203
 ```xml
@@ -245,18 +245,22 @@ You can invoke shutdown through curl.
245 245
 $ curl -X POST localhost:8080/shutdown
246 246
 ```
247 247
 
248
-The response shows that shutdown through REST is currently disabled:
248
+The response shows that shutdown through REST is currently disabled by default (thank goodness!):
249 249
 ```sh
250 250
 {"message":"Shutdown not enabled, sorry."}
251 251
 ```
252 252
 
253
-For more details about each of these REST points, you'll have to dig into the [Spring Boot][spring-boot] project itself.
253
+For more details about each of these REST points and how you can tune their settings with an ``application.properties` file, feel free to dig into the [Spring Boot][spring-boot] project.
254 254
 
255 255
 That is not all
256 256
 ---------------
257 257
 That last example showed how Spring Boot makes it easy to wire beans you may not be aware you need. And it showed how to turn on convenient management services.
258 258
 
259
-But Spring Boot does more than that. It supports not only traditional WAR file deployments, but also makes it easy to put together executable JARs thanks to Spring Boot's loader module. The various guides demonstrate this dual support through the `spring-boot-maven-plugin`. On top of that, Spring Boot also have Groovy support, allowing you to build web apps with as little as a single file:
259
+But Spring Boot does yet more. It supports not only traditional WAR file deployments, but also makes it easy to put together executable JARs thanks to Spring Boot's loader module. The various guides demonstrate this dual support through the `spring-boot-maven-plugin`. 
260
+
261
+On top of that, Spring Boot also has Groovy support, allowing you to build web apps with as little as a single file.
262
+
263
+Put the following code inside **app.groovy**:
260 264
 
261 265
 ```groovy
262 266
 @Controller
@@ -270,7 +274,10 @@ class ThisWillActuallyRun {
270 274
 
271 275
 }
272 276
 ```
273
-Spring Boot dynamically adds key annotations toy our code and leverages [Groovy Grapes](http://groovy.codehaus.org/Grape) to pull down needed libraries to make the app run. With Spring Boot's CLI tool, all you need do is:
277
+
278
+Next, [install Spring Boot's CLI](https://github.com/SpringSource/spring-boot#installing-the-cli).
279
+
280
+Finally, run it as follows:
274 281
 
275 282
 ```sh
276 283
 $ spring run app.groovy
@@ -278,6 +285,8 @@ $ curl localhost:8080
278 285
 Hello World!
279 286
 ```
280 287
 
288
+Spring Boot dynamically adds key annotations to your code and leverages [Groovy Grapes](http://groovy.codehaus.org/Grape) to pull down needed libraries to make the app run.
289
+
281 290
 Congratulations!
282 291
 ----------------
283 292
 Spring Boot is powerful, but frankly too big to fit into a single guide. This is just a sampling of how much it can ramp up your development pace, letting you focus on business features and not worry about infrastructure.

+ 16
- 7
README.md Näytä tiedosto

@@ -259,7 +259,7 @@ Add this to your build file's list of dependencies:
259 259
 
260 260
 Adding multipart upload support
261 261
 -------------------------------
262
-You should also update your configuration and add a `MultipartConfigElement` to the application context.
262
+Imagine you also want to add file upload support. To do that, update your configuration and add a `MultipartConfigElement` to the application context.
263 263
 
264 264
 `src/main/java/hello/Application.java`
265 265
 ```java
@@ -361,11 +361,11 @@ There is little change from the previous output, except there is no longer a `to
361 361
 
362 362
 There is also the `multipartConfigElement` you added. But along with it came a `multipartResolver` [courtesy of Spring Boot](https://github.com/SpringSource/spring-boot/blob/master/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/MultipartAutoConfiguration.java), a bean recommended to support file uploads with Spring MVC.
363 363
 
364
-Other than that, everything else appears the same, as it should be. Most the beans listed above provide Spring MVC's production-grade features. Just swapping one aspect, the container, and adding upload support shouldn't cause a system wide ripple.
364
+Other than that, everything else appears the same, as it should be. Most the beans listed above provide Spring MVC's production-grade features. Just swapping one part, the servlet container, and adding upload support shouldn't cause a system wide ripple.
365 365
 
366 366
 Adding consumer-grade services
367 367
 ------------------------------
368
-If you are building a web site for your business, there are probably some management services you are thinking about adding. Spring Boot provides several out of the box with it's [actuator module][spring-boot-actuator] like health, audits, beans, and more.
368
+If you are building a web site for your business, there are probably some management services you are thinking about adding. Spring Boot provides several out of the box with its [actuator module][spring-boot-actuator] like health, audits, beans, and more.
369 369
 
370 370
 Add this to your pom.xml:
371 371
 ```xml
@@ -413,18 +413,22 @@ You can invoke shutdown through curl.
413 413
 $ curl -X POST localhost:8080/shutdown
414 414
 ```
415 415
 
416
-The response shows that shutdown through REST is currently disabled:
416
+The response shows that shutdown through REST is currently disabled by default (thank goodness!):
417 417
 ```sh
418 418
 {"message":"Shutdown not enabled, sorry."}
419 419
 ```
420 420
 
421
-For more details about each of these REST points, you'll have to dig into the [Spring Boot][spring-boot] project itself.
421
+For more details about each of these REST points and how you can tune their settings with an ``application.properties` file, feel free to dig into the [Spring Boot][spring-boot] project.
422 422
 
423 423
 That is not all
424 424
 ---------------
425 425
 That last example showed how Spring Boot makes it easy to wire beans you may not be aware you need. And it showed how to turn on convenient management services.
426 426
 
427
-But Spring Boot does more than that. It supports not only traditional WAR file deployments, but also makes it easy to put together executable JARs thanks to Spring Boot's loader module. The various guides demonstrate this dual support through the `spring-boot-maven-plugin`. On top of that, Spring Boot also have Groovy support, allowing you to build web apps with as little as a single file:
427
+But Spring Boot does yet more. It supports not only traditional WAR file deployments, but also makes it easy to put together executable JARs thanks to Spring Boot's loader module. The various guides demonstrate this dual support through the `spring-boot-maven-plugin`. 
428
+
429
+On top of that, Spring Boot also has Groovy support, allowing you to build web apps with as little as a single file.
430
+
431
+Put the following code inside **app.groovy**:
428 432
 
429 433
 ```groovy
430 434
 @Controller
@@ -438,7 +442,10 @@ class ThisWillActuallyRun {
438 442
 
439 443
 }
440 444
 ```
441
-Spring Boot dynamically adds key annotations toy our code and leverages [Groovy Grapes](http://groovy.codehaus.org/Grape) to pull down needed libraries to make the app run. With Spring Boot's CLI tool, all you need do is:
445
+
446
+Next, [install Spring Boot's CLI](https://github.com/SpringSource/spring-boot#installing-the-cli).
447
+
448
+Finally, run it as follows:
442 449
 
443 450
 ```sh
444 451
 $ spring run app.groovy
@@ -446,6 +453,8 @@ $ curl localhost:8080
446 453
 Hello World!
447 454
 ```
448 455
 
456
+Spring Boot dynamically adds key annotations to your code and leverages [Groovy Grapes](http://groovy.codehaus.org/Grape) to pull down needed libraries to make the app run.
457
+
449 458
 Congratulations!
450 459
 ----------------
451 460
 Spring Boot is powerful, but frankly too big to fit into a single guide. This is just a sampling of how much it can ramp up your development pace, letting you focus on business features and not worry about infrastructure.