summaryrefslogtreecommitdiff
path: root/spring-boot/02-structure/src/main/java/com/example/spring/hello/HelloController.java
diff options
context:
space:
mode:
authorKamal Wickramanayake <kamal@inbox.lk>2026-05-16 21:18:32 +0530
committerKamal Wickramanayake <kamal@inbox.lk>2026-05-16 21:18:32 +0530
commite51834c899ff20781295410961934eb06239385c (patch)
tree78f0058914063e37cbd6812d204e4f84efd0ab90 /spring-boot/02-structure/src/main/java/com/example/spring/hello/HelloController.java
parentb1d598a2f02819bc127d0d3522dc7ac91b4dee65 (diff)
Added spring-boot sample applications
Diffstat (limited to 'spring-boot/02-structure/src/main/java/com/example/spring/hello/HelloController.java')
-rw-r--r--spring-boot/02-structure/src/main/java/com/example/spring/hello/HelloController.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/spring-boot/02-structure/src/main/java/com/example/spring/hello/HelloController.java b/spring-boot/02-structure/src/main/java/com/example/spring/hello/HelloController.java
new file mode 100644
index 0000000..ad89d9d
--- /dev/null
+++ b/spring-boot/02-structure/src/main/java/com/example/spring/hello/HelloController.java
@@ -0,0 +1,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 + "!";
+ }
+} \ No newline at end of file