Форма thymeleaf возвращает null вместо даты?
Model
public class Lot {
private UUID id;
private String status;
private LocalDate shippingDate;
private List<Package> packageList;
Controller
@GetMapping("/new")
public String newParcel(Model model){
model.addAttribute("lot", new Lot());
return "parcel/new";
}
@PostMapping()
public String create (@ModelAttribute("lot") Lot lot){
lot.setPackageList(new ArrayList<>());
lot.setId(UUID.randomUUID());
lotDAO.save(lot);
return "redirect:/parcel";
}
}
Form
<!DOCTYPE html>
<html lang="en" xmlns:th="http://thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Нове відправленя</title>
</head>
<body>
<form th:method="POST" th:action="@{/parcel}" th:object="${lot}">
<br/>
<label for="status" style="font-size: 25px; margin-right: 5px">Посилки: </label>
<select name="status" th:field="*{status}" id="status" style="font-size: 20px; margin-right:
10px">
<option value="Відправлені">Відправлені</option>
<option value="Отримані">Отримані</option>
</select>
<label for="shippingDate" style="font-size: 25px">дата:</label>
<input type="date" th:field="*{shippingDate}" id="shippingDate" style="font-size: 20px;
margin-right: 10px"/>
<input type="submit" value="Створити" style="font-size: 20px">
</form>
</body>
</html>