Commit 634f9a9c by Patryk Czarnik

Rozmowa - ramka ze stylem i ify

parent a1735cf4
......@@ -10,7 +10,9 @@ public class RozmowaController {
@RequestMapping("/rozmowa")
public String rozmowa(String imie, Model model) {
System.out.println("Przysłane imię: " + imie);
if(imie != null && !imie.isEmpty()) {
model.addAttribute("powitanie", "Witaj " + imie);
}
return "rozmowa.html";
}
......
......@@ -14,7 +14,9 @@
<button>OK</button>
</form>
<p th:text="${powitanie}">Lorem ipsum</p>
<div class="wynik"
th:if="${powitanie != null}"
th:text="${powitanie}">Lorem ipsum</div>
</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