Commit a1735cf4 by Patryk Czarnik

Rozmowa - odbiór parametru

parent 3ce13520
package com.example.demo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class RozmowaController {
@RequestMapping("/rozmowa")
public String rozmowa() {
public String rozmowa(String imie, Model model) {
System.out.println("Przysłane imię: " + imie);
model.addAttribute("powitanie", "Witaj " + imie);
return "rozmowa.html";
}
......
......@@ -14,5 +14,7 @@
<button>OK</button>
</form>
<p th:text="${powitanie}">Lorem ipsum</p>
</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