Я начал изучать Spring MVC и веб-разработку. У меня есть этот метод в моем контроллере
@GetMapping("/deleteCar")
public String deleteCar(@RequestParam("carId") int carid) {
carService.deleteCar(carid);
return "redirect:/car/cars";
}
Как я могу передать параметр запроса через html форму?
<section>
<form action="${pageContext.request.contextPath}/car/deleteCar">
<input type="text" id="deleteCarWithID" value="${carId}">
</form>
</section>
Я получаю это предупреждение:
WARNING: Resolved [org.springframework.web.bind.MissingServletRequestParameterException: Required int parameter 'carId' is not present]
Спасибо!