summaryrefslogtreecommitdiff
path: root/spring-boot/02-structure/src/main/java/com/example/spring/hello/HelloController.java
blob: ad89d9d748768f783cb3cdbafb3e2c5247f71c9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.example.spring.hello;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {

	@Value("${my.name}")
	private String name;
	
	@RequestMapping("/")
	@ResponseBody
	String home() {
		return "Hello " + name + "!";
	}
}