Skip to content

Commit 623e0e8

Browse files
committed
Add controller and view example
When accessing http://localhost:8080/foo, the bar.html page is rendered
1 parent a6f59d9 commit 623e0e8

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.example.myapp;
2+
3+
import org.springframework.stereotype.Controller;
4+
import org.springframework.web.bind.annotation.GetMapping;
5+
6+
@Controller
7+
public class MyController {
8+
@GetMapping("/foo")
9+
public String index() {
10+
return "bar";
11+
}
12+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>FooBar</p>

0 commit comments

Comments
 (0)