Commit b0126174 by Patryk Czarnik

Kalkulator - pusty formularz

parent d640e522
package alx.kalkulator;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class KalkulatorController {
@RequestMapping("/kalkulator")
public String kalkulator() {
return "kalkulator.html";
}
}
......@@ -36,7 +36,6 @@
<h2>Przykłady formularzy</h2>
<ul>
<li><a th:href="@{/moj_kalkulator}">Prosty Kalkulator</a> - wersja z zajęć</li>
<li><a th:href="@{/kalkulator}">Kalkulator</a> (formlularz)</li>
<li><a th:href="@{/kalkulator/historia}">Historia Kalkulatora HTML</a></li>
<li><a th:href="@{/historia.json}">Historia Kalkulatora JSON</a></li>
......
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Kalkulator</title>
<link rel="stylesheet" type="text/css" th:href="@{/styl.css}">
</head>
<body>
<h1>Kalkulator</h1>
<form method="get" class="kalkulator">
<input type="number" name="liczba1" th:value="${param.liczba1}">
<select name="operacja">
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
</select>
<input type="number" name="liczba2" th:value="${param.liczba2}">
<br>
<button>Oblicz</button>
</form>
<div><a th:href="@{/}">wróć do strony głównej</a></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