-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApplication.java
More file actions
32 lines (27 loc) · 1.12 KB
/
Application.java
File metadata and controls
32 lines (27 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.javacodenet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@SpringBootApplication
public class Application {
@Autowired
ApplicationArguments applicationArguments;
@RequestMapping("/")
public String programArguments() {
String output = "Application Startup Program arguments:";
for (String arg: applicationArguments.getOptionNames()) {
output = output + " " + arg;
}
return output;
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}