Skip to content

Commit

Permalink
Move command line runner details
Browse files Browse the repository at this point in the history
  • Loading branch information
gregturn committed Feb 24, 2016
1 parent f824f71 commit 9006bbe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ To upload files with Servlet 3.0 containers, you need to register a `MultipartCo
`src/main/java/hello/Application.java`
[source,java]
----
include::complete/src/main/java/hello/Application.java[]
include::initial/src/main/java/hello/Application.java[]
----

You also want a target folder to upload files to, so there is a Java 8 lambda used to create a Boot `CommandLineRunner` at startup which creates that folder.

You will soon add a Spring MVC controller, which is why you need `@SpringBootApplication`. Spring Boot automatically finds `@Controller`-marked classes and registers them with the application context.

As part of auto-configuring Spring MVC, Spring Boot will create a `MultipartConfigElement` bean and make itself ready for file uploads.
Expand Down Expand Up @@ -135,6 +133,8 @@ include::complete/src/main/java/hello/Application.java[]

The `main()` method uses Spring Boot's `SpringApplication.run()` method to launch an application. Did you notice that there wasn't a single line of XML? No **web.xml** file either. This web application is 100% pure Java and you didn't have to deal with configuring any plumbing or infrastructure.

You also want a target folder to upload files to, so there is a Java 8 lambda used to create a Boot `CommandLineRunner` at startup which creates that folder.


include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/build_an_executable_jar_subhead.adoc[]
include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/build_an_executable_jar_with_both.adoc[]
Expand Down

0 comments on commit 9006bbe

Please sign in to comment.