Initial commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package net.sytes.kashey.sweater;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
public class GreetingController {
|
||||
|
||||
@GetMapping("/greeting")
|
||||
public String greeting(@RequestParam(name = "name", required = false, defaultValue = "World") String name,
|
||||
Map<String, Object> model) {
|
||||
model.put("name", name);
|
||||
return "greeting";
|
||||
}
|
||||
|
||||
@GetMapping()
|
||||
public String root(Map<String, Object> model) {
|
||||
model.put("some", "Hello from main!!!");
|
||||
return "main";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package net.sytes.kashey.sweater;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class ServingWebContentApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ServingWebContentApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
10
src/main/resources/templates/greeting.mustache
Normal file
10
src/main/resources/templates/greeting.mustache
Normal file
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Getting Started: Serving Web Content</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
</head>
|
||||
<body>
|
||||
<div>Hello {{name}}!!!</div>
|
||||
</body>
|
||||
</html>
|
||||
5
src/main/resources/templates/main.mustache
Normal file
5
src/main/resources/templates/main.mustache
Normal file
@@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
<div>{{some}}<div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user