Added a few comments to server java files
This commit is contained in:
@@ -3,9 +3,11 @@ package hello;
|
|||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
//application to boot with spring
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class Application {
|
public class Application {
|
||||||
|
|
||||||
|
//run the application
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(Application.class, args);
|
SpringApplication.run(Application.class, args);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ public class GreetingController {
|
|||||||
|
|
||||||
@RequestMapping("/greeting")
|
@RequestMapping("/greeting")
|
||||||
public Greeting greeting(@RequestParam(value="name", defaultValue="World") String name) {
|
public Greeting greeting(@RequestParam(value="name", defaultValue="World") String name) {
|
||||||
|
//increment the id every time the page is refreshed (a new user visits the page)
|
||||||
return new Greeting(counter.incrementAndGet(),
|
return new Greeting(counter.incrementAndGet(),
|
||||||
String.format(template, name));
|
String.format(template, name));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user