Delete HelloWorld

This commit is contained in:
2020-09-28 14:01:44 -04:00
parent deed9d35ec
commit a551c1a882
2 changed files with 0 additions and 39 deletions

View File

@ -1,23 +0,0 @@
package MTGClone.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class HelloController {
@GetMapping({"/hello"})
public String hello(Model model, @RequestParam(value="name", required=false, defaultValue="World") String name) {
model.addAttribute("name", name);
return "hello";
}
@PostMapping({"/greet"})
public String greet(@RequestParam("name") String name, ModelMap modelMap) {
modelMap.put("name", name);
return "hello";
}
}

View File

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Hello ${name}!</title>
</head>
<body>
<h2 class="hello-title">Hello ${name}!</h2>
<form action="/greet" method="post">
<label for="fname">First name:</label>
<input type="text" id="name" name="name"><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>