瀏覽代碼

Add macro for @SpringBootApplication description

Dave Syer 8 年之前
父節點
當前提交
c53131d0d7
共有 1 個檔案被更改,包括 1 行新增8 行删除
  1. 1
    8
      README.adoc

+ 1
- 8
README.adoc 查看文件

@@ -64,14 +64,7 @@ Here you create an `Application` class with the components:
64 64
 include::initial/src/main/java/hello/Application.java[]
65 65
 ----
66 66
 
67
-`@SpringBootApplication` is a convenience annotation that adds all of the following:
68
-    
69
-- `@Configuration` tags the class as a source of bean definitions for the application context.
70
-- `@EnableAutoConfiguration` tells Spring Boot to start adding beans based on classpath settings, other beans, and various property settings.
71
-- Normally you would add `@EnableWebMvc` for a Spring MVC app, but Spring Boot adds it automatically when it sees **spring-webmvc** on the classpath. This flags the application as a web application and activates key behaviors such as setting up a `DispatcherServlet`.
72
-- `@ComponentScan` tells Spring to look for other components, configurations, and services in the the `hello` package, allowing it to find the `HelloController`.
73
-
74
-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.
67
+include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/spring-boot-application.adoc[]
75 68
 
76 69
 There is also a `CommandLineRunner` method marked as a `@Bean` and this runs on start up. It retrieves all the beans that were created either by your app or were automatically added thanks to Spring Boot. It sorts them and prints them out.
77 70