Commit 8844e794 by Patryk Czarnik

Szablon HTML :-)

parent c726c36d
package sklep.controller; package sklep.controller;
import java.time.LocalDateTime;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
...@@ -10,9 +8,8 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -10,9 +8,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
public class RootController { public class RootController {
@RequestMapping("/") @RequestMapping("/")
@ResponseBody
public String index() { public String index() {
return "Spis treści"; return "spis.html";
} }
@RequestMapping("/hello") @RequestMapping("/hello")
...@@ -21,11 +18,4 @@ public class RootController { ...@@ -21,11 +18,4 @@ public class RootController {
return "Hello Spring"; return "Hello Spring";
} }
@RequestMapping("/time")
@ResponseBody
public String ktoraGodzina() {
LocalDateTime dt = LocalDateTime.now();
return dt.toString();
}
} }
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Spis HTML</title>
</head>
<body>
<h1>Spis HTML</h1>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment