Commit e26c03e2 by Patryk Czarnik

Adres na poziomie klasy a @GetMapping w kodzie

parent 43f23650
......@@ -7,14 +7,15 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/kalkulator")
public class KalkulatorController {
@GetMapping("/kalkulator")
@GetMapping
public String kalkulatorGet() {
return "kalkulator.html";
}
@PostMapping("/kalkulator")
@PostMapping
public String kalkulator(Long liczba1, Long liczba2, String operacja, Model model) {
Long wynik = switch (operacja) {
case "+" -> liczba1 + liczba2;
......
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