Commit f40ef742 by Patryk Czarnik

time5 - początek

parent cba8a466
......@@ -28,7 +28,7 @@ public class TimeController {
}
private static final DateTimeFormatter FORMAT_DATY = DateTimeFormatter
.ofPattern("EEEE, dd.MM.YYYY, 'godzina' HH:mm:ss", new Locale("pl", "PL"));
.ofPattern("EEEE, dd.MM.yyyy, 'godzina' HH:mm:ss", new Locale("pl", "PL"));
// Aby powiedzieć wprost, jaki jest format (content-type) odpowiedzi zwracanej przez metdę, można uzyć parametru produces
@RequestMapping(path="/time3", produces="text/plain")
......@@ -52,5 +52,10 @@ public class TimeController {
dt.toLocalTime(), dt.toLocalDate(), dt.format(FORMAT_DATY));
}
@RequestMapping("/time5")
public String time5() {
LocalDateTime dateTime = LocalDateTime.now();
return "szablon5.html";
}
}
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>Która godzina</title>
</head>
<body>
<h1>Szablon 5</h1>
<p>Zaraz powiem, która godzina...</p>
</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