|
|
@@ -138,12 +138,12 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
138
|
138
|
|
|
139
|
139
|
@Controller
|
|
140
|
140
|
public class HelloController {
|
|
141
|
|
-
|
|
142
|
|
- @RequestMapping("/")
|
|
143
|
|
- public @ResponseBody String index() {
|
|
144
|
|
- return "Greetings from Spring Boot!";
|
|
145
|
|
- }
|
|
146
|
|
-
|
|
|
141
|
+
|
|
|
142
|
+ @RequestMapping("/")
|
|
|
143
|
+ public @ResponseBody String index() {
|
|
|
144
|
+ return "Greetings from Spring Boot!";
|
|
|
145
|
+ }
|
|
|
146
|
+
|
|
147
|
147
|
}
|
|
148
|
148
|
```
|
|
149
|
149
|
|
|
|
@@ -171,18 +171,18 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
|
171
|
171
|
@EnableWebMvc
|
|
172
|
172
|
@ComponentScan
|
|
173
|
173
|
public class Application {
|
|
174
|
|
-
|
|
175
|
|
- public static void main(String[] args) {
|
|
176
|
|
- ApplicationContext ctx = SpringApplication.run(Application.class, args);
|
|
177
|
|
-
|
|
178
|
|
- System.out.println("Let's inspect the beans provided by Spring Boot:");
|
|
179
|
|
-
|
|
180
|
|
- String[] beanNames = ctx.getBeanDefinitionNames();
|
|
181
|
|
- Arrays.sort(beanNames);
|
|
182
|
|
- for (String beanName : beanNames) {
|
|
183
|
|
- System.out.println(beanName);
|
|
184
|
|
- }
|
|
185
|
|
- }
|
|
|
174
|
+
|
|
|
175
|
+ public static void main(String[] args) {
|
|
|
176
|
+ ApplicationContext ctx = SpringApplication.run(Application.class, args);
|
|
|
177
|
+
|
|
|
178
|
+ System.out.println("Let's inspect the beans provided by Spring Boot:");
|
|
|
179
|
+
|
|
|
180
|
+ String[] beanNames = ctx.getBeanDefinitionNames();
|
|
|
181
|
+ Arrays.sort(beanNames);
|
|
|
182
|
+ for (String beanName : beanNames) {
|
|
|
183
|
+ System.out.println(beanName);
|
|
|
184
|
+ }
|
|
|
185
|
+ }
|
|
186
|
186
|
|
|
187
|
187
|
}
|
|
188
|
188
|
```
|
|
|
@@ -291,23 +291,23 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
|
291
|
291
|
@EnableWebMvc
|
|
292
|
292
|
@ComponentScan
|
|
293
|
293
|
public class Application {
|
|
294
|
|
-
|
|
295
|
|
- @Bean
|
|
296
|
|
- MultipartConfigElement multipartConfigElement() {
|
|
297
|
|
- return new MultipartConfigElement("");
|
|
298
|
|
- }
|
|
299
|
|
-
|
|
300
|
|
- public static void main(String[] args) {
|
|
301
|
|
- ApplicationContext ctx = SpringApplication.run(Application.class, args);
|
|
302
|
|
-
|
|
303
|
|
- System.out.println("Let's inspect the beans provided by Spring Boot:");
|
|
304
|
|
-
|
|
305
|
|
- String[] beanNames = ctx.getBeanDefinitionNames();
|
|
306
|
|
- Arrays.sort(beanNames);
|
|
307
|
|
- for (String beanName : beanNames) {
|
|
308
|
|
- System.out.println(beanName);
|
|
309
|
|
- }
|
|
310
|
|
- }
|
|
|
294
|
+
|
|
|
295
|
+ @Bean
|
|
|
296
|
+ MultipartConfigElement multipartConfigElement() {
|
|
|
297
|
+ return new MultipartConfigElement("");
|
|
|
298
|
+ }
|
|
|
299
|
+
|
|
|
300
|
+ public static void main(String[] args) {
|
|
|
301
|
+ ApplicationContext ctx = SpringApplication.run(Application.class, args);
|
|
|
302
|
+
|
|
|
303
|
+ System.out.println("Let's inspect the beans provided by Spring Boot:");
|
|
|
304
|
+
|
|
|
305
|
+ String[] beanNames = ctx.getBeanDefinitionNames();
|
|
|
306
|
+ Arrays.sort(beanNames);
|
|
|
307
|
+ for (String beanName : beanNames) {
|
|
|
308
|
+ System.out.println(beanName);
|
|
|
309
|
+ }
|
|
|
310
|
+ }
|
|
311
|
311
|
|
|
312
|
312
|
}
|
|
313
|
313
|
```
|