Commit d2173eec by Patryk Czarnik

przykład blog - początek

parent 2e735883
package org.example.demo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class BlogController {
@GetMapping("/blog")
public String dzialaj(Model model) {
return "blog.html";
}
}
<!DOCTYPE html>
<html lang="pl" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Blog</title>
<link rel="stylesheet" type="text/css" th:href="@{/styl.css}" href="../static/styl.css">
</head>
<body>
<h1>Blog - wersja webowa</h1>
<form method="post">
<label for="tekst">Napisz coś:</label><input id="tekst" name="tekst" type="text"><br>
<button>OK</button>
</form>
<section>
<h2>Zapamiętane teksty:</h2>
<ul>
<li th:each="tekst : ${teksty}" th:text="${tekst}">przykładowy tekst</li>
</ul>
</section>
</body>
</html>
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