Преглед на файлове

Polish up Spring Boot based on feedback from @philwebb

Greg Turnquist преди 13 години
родител
ревизия
0076446db1
променени са 6 файла, в които са добавени 79 реда и са изтрити 59 реда
  1. 35
    19
      README.ftl.md
  2. 35
    29
      README.md
  3. 3
    1
      complete/build.gradle
  4. 6
    0
      complete/pom.xml
  5. 0
    9
      complete/src/main/java/hello/Application.java
  6. 0
    1
      initial/src/main/java/hello/Application.java

+ 35
- 19
README.ftl.md Целия файл

79
 
79
 
80
 You should see some output like this:
80
 You should see some output like this:
81
 
81
 
82
-```sh
82
+```
83
 Let's inspect the beans provided by Spring Boot:
83
 Let's inspect the beans provided by Spring Boot:
84
 application
84
 application
85
 beanNameHandlerMapping
85
 beanNameHandlerMapping
130
 ---------------------------
130
 ---------------------------
131
 What if you prefer Jetty over Tomcat? Jetty and Tomcat are both compliant servlet containers, so it should be easy to switch. With Spring Boot, it is!
131
 What if you prefer Jetty over Tomcat? Jetty and Tomcat are both compliant servlet containers, so it should be easy to switch. With Spring Boot, it is!
132
 
132
 
133
-Add this to your `build.gradle` list of dependencies:
133
+Change your `build.gradle` to exclude Tomcat then add Jetty to the list of dependencies:
134
 
134
 
135
 ```groovy
135
 ```groovy
136
+    compile("org.springframework.boot:spring-boot-starter-web:0.5.0.BUILD-SNAPSHOT") {
137
+        exclude module: "spring-boot-starter-tomcat"
138
+    }
136
     compile("org.springframework.boot:spring-boot-starter-jetty:0.5.0.BUILD-SNAPSHOT")
139
     compile("org.springframework.boot:spring-boot-starter-jetty:0.5.0.BUILD-SNAPSHOT")
137
 ```
140
 ```
138
 
141
 
139
-If you are using Maven, add this to your list of dependencies:
142
+If you are using Maven, the changes look like this:
140
 
143
 
141
 ```xml
144
 ```xml
142
         <dependency>
145
         <dependency>
143
             <groupId>org.springframework.boot</groupId>
146
             <groupId>org.springframework.boot</groupId>
147
+            <artifactId>spring-boot-starter-web</artifactId>
148
+            <exclusions>
149
+                <exclusion>
150
+                    <groupId>org.springframework.boot</groupId>
151
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
152
+                </exclusion>
153
+            </exclusions>
154
+        </dependency>
155
+        <dependency>
156
+            <groupId>org.springframework.boot</groupId>
144
             <artifactId>spring-boot-starter-jetty</artifactId>
157
             <artifactId>spring-boot-starter-jetty</artifactId>
145
         </dependency>
158
         </dependency>
146
 ```
159
 ```
147
 
160
 
148
-Add multipart upload support
149
--------------------------------
150
-Suppose you want to add file upload support. To do that, update your configuration by adding a `MultipartConfigElement` to the application context.
161
+This change isn't about comparing Tomcat vs. Jetty. Instead, it demonstrates how Spring Boot reacts to what is on your classpath.
162
+
163
+Another example is [Uploading Files][gs-uploading-files]. In that guide, you can see how Spring Boot reacts to adding a `MultipartConfigElement` to your application context. Spring Boot automatically plugs that bean into the DispatcherServlet and adds some other beans needed to support file uploads.
164
+
165
+As you can see below, the code is the same as before:
151
 
166
 
152
     <@snippet path="src/main/java/hello/Application.java" prefix="complete"/>
167
     <@snippet path="src/main/java/hello/Application.java" prefix="complete"/>
153
     
168
     
154
-> **Note:** A production version of `MultipartConfigElement` would not be empty; it would specify target upload path, file size upload limits, and so forth.
155
 
169
 
156
 Re-run the application
170
 Re-run the application
157
 ----------------------
171
 ----------------------
170
 
184
 
171
 Now check out the output:
185
 Now check out the output:
172
 
186
 
173
-```sh
187
+```
174
 Let's inspect the beans provided by Spring Boot:
188
 Let's inspect the beans provided by Spring Boot:
175
 application
189
 application
176
 beanNameHandlerMapping
190
 beanNameHandlerMapping
177
 defaultServletHandlerMapping
191
 defaultServletHandlerMapping
178
 dispatcherServlet
192
 dispatcherServlet
179
 embeddedServletContainerCustomizerBeanPostProcessor
193
 embeddedServletContainerCustomizerBeanPostProcessor
194
+faviconHandlerMapping
195
+faviconRequestHandler
180
 handlerExceptionResolver
196
 handlerExceptionResolver
181
 helloController
197
 helloController
198
+hiddenHttpMethodFilter
182
 httpRequestHandlerAdapter
199
 httpRequestHandlerAdapter
183
 jettyEmbeddedServletContainerFactory
200
 jettyEmbeddedServletContainerFactory
184
 messageSource
201
 messageSource
185
-multipartConfigElement
186
-multipartResolver
187
 mvcContentNegotiationManager
202
 mvcContentNegotiationManager
188
 mvcConversionService
203
 mvcConversionService
189
 mvcValidator
204
 mvcValidator
192
 org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration
207
 org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration
193
 org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$DispatcherServletConfiguration
208
 org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$DispatcherServletConfiguration
194
 org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedJetty
209
 org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedJetty
195
-org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration
196
 org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration
210
 org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration
211
+org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration
212
+org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter
213
+org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter$FaviconConfiguration
197
 org.springframework.boot.context.embedded.properties.ServerProperties
214
 org.springframework.boot.context.embedded.properties.ServerProperties
198
 org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor
215
 org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor
199
 org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor
216
 org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor
211
 viewControllerHandlerMapping
228
 viewControllerHandlerMapping
212
 ```
229
 ```
213
 
230
 
214
-Little changes from the previous output, except there is no longer a `tomcatEmbeddedServletContainerFactory`. Instead, there is a new `jettyEmbeddedServletContainer`. 
231
+There is little change from the previous output, except there is no longer a `tomcatEmbeddedServletContainerFactory`. Instead, there is a new `jettyEmbeddedServletContainer`. 
215
 
232
 
216
-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.
217
-
218
-Otherwise, everything is the same, as it should be. Most beans listed above provide Spring MVC's production-grade features. Simply swapping one part, the servlet container, and adding upload support shouldn't cause a system-wide ripple.
233
+Otherwise, everything is the same, as it should be. Most beans listed above provide Spring MVC's production-grade features. Simply swapping one part, the servlet container, shouldn't cause a system-wide ripple.
219
 
234
 
220
 Add consumer-grade services
235
 Add consumer-grade services
221
 ------------------------------
236
 ------------------------------
250
 
265
 
251
 You will see a new set of RESTful end points added to the application. These are management services provided by Spring Boot.
266
 You will see a new set of RESTful end points added to the application. These are management services provided by Spring Boot.
252
 
267
 
253
-```sh
268
+```
254
 2013-08-01 08:03:42.592  INFO 43851 ... Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.util.Map<java.lang.String, java.lang.Object> org.springframework.boot.ops.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
269
 2013-08-01 08:03:42.592  INFO 43851 ... Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.util.Map<java.lang.String, java.lang.Object> org.springframework.boot.ops.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
255
 2013-08-01 08:03:42.592  INFO 43851 ... Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[text/html],custom=[]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.ops.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)
270
 2013-08-01 08:03:42.592  INFO 43851 ... Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[text/html],custom=[]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.ops.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)
256
 2013-08-01 08:03:42.844  INFO 43851 ... Mapped URL path [/env] onto handler of type [class org.springframework.boot.ops.endpoint.EnvironmentEndpoint]
271
 2013-08-01 08:03:42.844  INFO 43851 ... Mapped URL path [/env] onto handler of type [class org.springframework.boot.ops.endpoint.EnvironmentEndpoint]
306
 ------------------------------
321
 ------------------------------
307
 The last example showed how Spring Boot makes it easy to wire beans you may not be aware that you need. And it showed how to turn on convenient management services.
322
 The last example showed how Spring Boot makes it easy to wire beans you may not be aware that you need. And it showed how to turn on convenient management services.
308
 
323
 
309
-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-gradle-plugin`.
324
+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-gradle-plugin` and `spring-boot-maven-plugin`.
310
 
325
 
311
-On top of that, Spring Boot also has Groovy support, allowing you to build web apps with as little as a single file.
326
+On top of that, Spring Boot also has Groovy support, allowing you to build Spring MVC web apps with as little as a single file.
312
 
327
 
313
 Create a new file called **app.groovy** and put the following code in it:
328
 Create a new file called **app.groovy** and put the following code in it:
314
 
329
 
343
 Hello World!
358
 Hello World!
344
 ```
359
 ```
345
 
360
 
346
-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.
361
+Spring Boot does this by dynamically adding key annotations to your code and leveraging [Groovy Grapes](http://groovy.codehaus.org/Grape) to pull down needed libraries to make the app run.
347
 
362
 
348
 Summary
363
 Summary
349
 ----------------
364
 ----------------
351
 
366
 
352
 [spring-boot]: https://github.com/SpringSource/spring-boot
367
 [spring-boot]: https://github.com/SpringSource/spring-boot
353
 [spring-boot-actuator]: https://github.com/SpringSource/spring-boot/blob/master/spring-boot-actuator/README.md
368
 [spring-boot-actuator]: https://github.com/SpringSource/spring-boot/blob/master/spring-boot-actuator/README.md
369
+[gs-uploading-files]: /guides/gs/uploading-files

+ 35
- 29
README.md Целия файл

148
 import org.springframework.context.ApplicationContext;
148
 import org.springframework.context.ApplicationContext;
149
 import org.springframework.context.annotation.ComponentScan;
149
 import org.springframework.context.annotation.ComponentScan;
150
 import org.springframework.context.annotation.Configuration;
150
 import org.springframework.context.annotation.Configuration;
151
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
152
 
151
 
153
 @Configuration
152
 @Configuration
154
 @EnableAutoConfiguration
153
 @EnableAutoConfiguration
195
 
194
 
196
 You should see some output like this:
195
 You should see some output like this:
197
 
196
 
198
-```sh
197
+```
199
 Let's inspect the beans provided by Spring Boot:
198
 Let's inspect the beans provided by Spring Boot:
200
 application
199
 application
201
 beanNameHandlerMapping
200
 beanNameHandlerMapping
246
 ---------------------------
245
 ---------------------------
247
 What if you prefer Jetty over Tomcat? Jetty and Tomcat are both compliant servlet containers, so it should be easy to switch. With Spring Boot, it is!
246
 What if you prefer Jetty over Tomcat? Jetty and Tomcat are both compliant servlet containers, so it should be easy to switch. With Spring Boot, it is!
248
 
247
 
249
-Add this to your `build.gradle` list of dependencies:
248
+Change your `build.gradle` to exclude Tomcat then add Jetty to the list of dependencies:
250
 
249
 
251
 ```groovy
250
 ```groovy
251
+    compile("org.springframework.boot:spring-boot-starter-web:0.5.0.BUILD-SNAPSHOT") {
252
+        exclude module: "spring-boot-starter-tomcat"
253
+    }
252
     compile("org.springframework.boot:spring-boot-starter-jetty:0.5.0.BUILD-SNAPSHOT")
254
     compile("org.springframework.boot:spring-boot-starter-jetty:0.5.0.BUILD-SNAPSHOT")
253
 ```
255
 ```
254
 
256
 
255
-If you are using Maven, add this to your list of dependencies:
257
+If you are using Maven, the changes look like this:
256
 
258
 
257
 ```xml
259
 ```xml
258
         <dependency>
260
         <dependency>
259
             <groupId>org.springframework.boot</groupId>
261
             <groupId>org.springframework.boot</groupId>
262
+            <artifactId>spring-boot-starter-web</artifactId>
263
+            <exclusions>
264
+                <exclusion>
265
+                    <groupId>org.springframework.boot</groupId>
266
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
267
+                </exclusion>
268
+            </exclusions>
269
+        </dependency>
270
+        <dependency>
271
+            <groupId>org.springframework.boot</groupId>
260
             <artifactId>spring-boot-starter-jetty</artifactId>
272
             <artifactId>spring-boot-starter-jetty</artifactId>
261
         </dependency>
273
         </dependency>
262
 ```
274
 ```
263
 
275
 
264
-Add multipart upload support
265
--------------------------------
266
-Suppose you want to add file upload support. To do that, update your configuration by adding a `MultipartConfigElement` to the application context.
276
+This change isn't about comparing Tomcat vs. Jetty. Instead, it demonstrates how Spring Boot reacts to what is on your classpath.
277
+
278
+Another example is [Uploading Files][gs-uploading-files]. In that guide, you can see how Spring Boot reacts to adding a `MultipartConfigElement` to your application context. Spring Boot automatically plugs that bean into the DispatcherServlet and adds some other beans needed to support file uploads.
279
+
280
+As you can see below, the code is the same as before:
267
 
281
 
268
 `src/main/java/hello/Application.java`
282
 `src/main/java/hello/Application.java`
269
 ```java
283
 ```java
271
 
285
 
272
 import java.util.Arrays;
286
 import java.util.Arrays;
273
 
287
 
274
-import javax.servlet.MultipartConfigElement;
275
-
276
 import org.springframework.boot.SpringApplication;
288
 import org.springframework.boot.SpringApplication;
277
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
289
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
278
 import org.springframework.context.ApplicationContext;
290
 import org.springframework.context.ApplicationContext;
279
-import org.springframework.context.annotation.Bean;
280
 import org.springframework.context.annotation.ComponentScan;
291
 import org.springframework.context.annotation.ComponentScan;
281
 import org.springframework.context.annotation.Configuration;
292
 import org.springframework.context.annotation.Configuration;
282
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
283
 
293
 
284
 @Configuration
294
 @Configuration
285
 @EnableAutoConfiguration
295
 @EnableAutoConfiguration
286
 @ComponentScan
296
 @ComponentScan
287
 public class Application {
297
 public class Application {
288
     
298
     
289
-    @Bean
290
-    MultipartConfigElement multipartConfigElement() {
291
-        return new MultipartConfigElement("");
292
-    }
293
-    
294
     public static void main(String[] args) {
299
     public static void main(String[] args) {
295
         ApplicationContext ctx = SpringApplication.run(Application.class, args);
300
         ApplicationContext ctx = SpringApplication.run(Application.class, args);
296
         
301
         
306
 }
311
 }
307
 ```
312
 ```
308
     
313
     
309
-> **Note:** A production version of `MultipartConfigElement` would not be empty; it would specify target upload path, file size upload limits, and so forth.
310
 
314
 
311
 Re-run the application
315
 Re-run the application
312
 ----------------------
316
 ----------------------
325
 
329
 
326
 Now check out the output:
330
 Now check out the output:
327
 
331
 
328
-```sh
332
+```
329
 Let's inspect the beans provided by Spring Boot:
333
 Let's inspect the beans provided by Spring Boot:
330
 application
334
 application
331
 beanNameHandlerMapping
335
 beanNameHandlerMapping
332
 defaultServletHandlerMapping
336
 defaultServletHandlerMapping
333
 dispatcherServlet
337
 dispatcherServlet
334
 embeddedServletContainerCustomizerBeanPostProcessor
338
 embeddedServletContainerCustomizerBeanPostProcessor
339
+faviconHandlerMapping
340
+faviconRequestHandler
335
 handlerExceptionResolver
341
 handlerExceptionResolver
336
 helloController
342
 helloController
343
+hiddenHttpMethodFilter
337
 httpRequestHandlerAdapter
344
 httpRequestHandlerAdapter
338
 jettyEmbeddedServletContainerFactory
345
 jettyEmbeddedServletContainerFactory
339
 messageSource
346
 messageSource
340
-multipartConfigElement
341
-multipartResolver
342
 mvcContentNegotiationManager
347
 mvcContentNegotiationManager
343
 mvcConversionService
348
 mvcConversionService
344
 mvcValidator
349
 mvcValidator
347
 org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration
352
 org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration
348
 org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$DispatcherServletConfiguration
353
 org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$DispatcherServletConfiguration
349
 org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedJetty
354
 org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedJetty
350
-org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration
351
 org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration
355
 org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration
356
+org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration
357
+org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter
358
+org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter$FaviconConfiguration
352
 org.springframework.boot.context.embedded.properties.ServerProperties
359
 org.springframework.boot.context.embedded.properties.ServerProperties
353
 org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor
360
 org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor
354
 org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor
361
 org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor
366
 viewControllerHandlerMapping
373
 viewControllerHandlerMapping
367
 ```
374
 ```
368
 
375
 
369
-Little changes from the previous output, except there is no longer a `tomcatEmbeddedServletContainerFactory`. Instead, there is a new `jettyEmbeddedServletContainer`. 
370
-
371
-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.
376
+There is little change from the previous output, except there is no longer a `tomcatEmbeddedServletContainerFactory`. Instead, there is a new `jettyEmbeddedServletContainer`. 
372
 
377
 
373
-Otherwise, everything is the same, as it should be. Most beans listed above provide Spring MVC's production-grade features. Simply swapping one part, the servlet container, and adding upload support shouldn't cause a system-wide ripple.
378
+Otherwise, everything is the same, as it should be. Most beans listed above provide Spring MVC's production-grade features. Simply swapping one part, the servlet container, shouldn't cause a system-wide ripple.
374
 
379
 
375
 Add consumer-grade services
380
 Add consumer-grade services
376
 ------------------------------
381
 ------------------------------
405
 
410
 
406
 You will see a new set of RESTful end points added to the application. These are management services provided by Spring Boot.
411
 You will see a new set of RESTful end points added to the application. These are management services provided by Spring Boot.
407
 
412
 
408
-```sh
413
+```
409
 2013-08-01 08:03:42.592  INFO 43851 ... Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.util.Map<java.lang.String, java.lang.Object> org.springframework.boot.ops.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
414
 2013-08-01 08:03:42.592  INFO 43851 ... Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.util.Map<java.lang.String, java.lang.Object> org.springframework.boot.ops.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
410
 2013-08-01 08:03:42.592  INFO 43851 ... Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[text/html],custom=[]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.ops.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)
415
 2013-08-01 08:03:42.592  INFO 43851 ... Mapped "{[/error],methods=[],params=[],headers=[],consumes=[],produces=[text/html],custom=[]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.ops.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)
411
 2013-08-01 08:03:42.844  INFO 43851 ... Mapped URL path [/env] onto handler of type [class org.springframework.boot.ops.endpoint.EnvironmentEndpoint]
416
 2013-08-01 08:03:42.844  INFO 43851 ... Mapped URL path [/env] onto handler of type [class org.springframework.boot.ops.endpoint.EnvironmentEndpoint]
461
 ------------------------------
466
 ------------------------------
462
 The last example showed how Spring Boot makes it easy to wire beans you may not be aware that you need. And it showed how to turn on convenient management services.
467
 The last example showed how Spring Boot makes it easy to wire beans you may not be aware that you need. And it showed how to turn on convenient management services.
463
 
468
 
464
-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-gradle-plugin`.
469
+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-gradle-plugin` and `spring-boot-maven-plugin`.
465
 
470
 
466
-On top of that, Spring Boot also has Groovy support, allowing you to build web apps with as little as a single file.
471
+On top of that, Spring Boot also has Groovy support, allowing you to build Spring MVC web apps with as little as a single file.
467
 
472
 
468
 Create a new file called **app.groovy** and put the following code in it:
473
 Create a new file called **app.groovy** and put the following code in it:
469
 
474
 
498
 Hello World!
503
 Hello World!
499
 ```
504
 ```
500
 
505
 
501
-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.
506
+Spring Boot does this by dynamically adding key annotations to your code and leveraging [Groovy Grapes](http://groovy.codehaus.org/Grape) to pull down needed libraries to make the app run.
502
 
507
 
503
 Summary
508
 Summary
504
 ----------------
509
 ----------------
506
 
511
 
507
 [spring-boot]: https://github.com/SpringSource/spring-boot
512
 [spring-boot]: https://github.com/SpringSource/spring-boot
508
 [spring-boot-actuator]: https://github.com/SpringSource/spring-boot/blob/master/spring-boot-actuator/README.md
513
 [spring-boot-actuator]: https://github.com/SpringSource/spring-boot/blob/master/spring-boot-actuator/README.md
514
+[gs-uploading-files]: /guides/gs/uploading-files

+ 3
- 1
complete/build.gradle Целия файл

24
 }
24
 }
25
 
25
 
26
 dependencies {
26
 dependencies {
27
-    compile("org.springframework.boot:spring-boot-starter-web:0.5.0.BUILD-SNAPSHOT")
27
+    compile("org.springframework.boot:spring-boot-starter-web:0.5.0.BUILD-SNAPSHOT") {
28
+        exclude module: "spring-boot-starter-tomcat"
29
+    }
28
     compile("org.springframework.boot:spring-boot-starter-jetty:0.5.0.BUILD-SNAPSHOT")
30
     compile("org.springframework.boot:spring-boot-starter-jetty:0.5.0.BUILD-SNAPSHOT")
29
     compile("org.springframework.boot:spring-boot-starter-actuator:0.5.0.BUILD-SNAPSHOT")
31
     compile("org.springframework.boot:spring-boot-starter-actuator:0.5.0.BUILD-SNAPSHOT")
30
     testCompile("junit:junit:4.11")
32
     testCompile("junit:junit:4.11")

+ 6
- 0
complete/pom.xml Целия файл

17
         <dependency>
17
         <dependency>
18
             <groupId>org.springframework.boot</groupId>
18
             <groupId>org.springframework.boot</groupId>
19
             <artifactId>spring-boot-starter-web</artifactId>
19
             <artifactId>spring-boot-starter-web</artifactId>
20
+            <exclusions>
21
+                <exclusion>
22
+                    <groupId>org.springframework.boot</groupId>
23
+                    <artifactId>spring-boot-starter-tomcat</artifactId>
24
+                </exclusion>
25
+	    </exclusions>
20
         </dependency>
26
         </dependency>
21
         <dependency>
27
         <dependency>
22
             <groupId>org.springframework.boot</groupId>
28
             <groupId>org.springframework.boot</groupId>

+ 0
- 9
complete/src/main/java/hello/Application.java Целия файл

2
 
2
 
3
 import java.util.Arrays;
3
 import java.util.Arrays;
4
 
4
 
5
-import javax.servlet.MultipartConfigElement;
6
-
7
 import org.springframework.boot.SpringApplication;
5
 import org.springframework.boot.SpringApplication;
8
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
6
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
9
 import org.springframework.context.ApplicationContext;
7
 import org.springframework.context.ApplicationContext;
10
-import org.springframework.context.annotation.Bean;
11
 import org.springframework.context.annotation.ComponentScan;
8
 import org.springframework.context.annotation.ComponentScan;
12
 import org.springframework.context.annotation.Configuration;
9
 import org.springframework.context.annotation.Configuration;
13
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
14
 
10
 
15
 @Configuration
11
 @Configuration
16
 @EnableAutoConfiguration
12
 @EnableAutoConfiguration
17
 @ComponentScan
13
 @ComponentScan
18
 public class Application {
14
 public class Application {
19
     
15
     
20
-    @Bean
21
-    MultipartConfigElement multipartConfigElement() {
22
-        return new MultipartConfigElement("");
23
-    }
24
-    
25
     public static void main(String[] args) {
16
     public static void main(String[] args) {
26
         ApplicationContext ctx = SpringApplication.run(Application.class, args);
17
         ApplicationContext ctx = SpringApplication.run(Application.class, args);
27
         
18
         

+ 0
- 1
initial/src/main/java/hello/Application.java Целия файл

7
 import org.springframework.context.ApplicationContext;
7
 import org.springframework.context.ApplicationContext;
8
 import org.springframework.context.annotation.ComponentScan;
8
 import org.springframework.context.annotation.ComponentScan;
9
 import org.springframework.context.annotation.Configuration;
9
 import org.springframework.context.annotation.Configuration;
10
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
11
 
10
 
12
 @Configuration
11
 @Configuration
13
 @EnableAutoConfiguration
12
 @EnableAutoConfiguration