On the page there are products, the code is responsible for the button "more" on the product.
<c:url value="/aboutCourse" var="aboutCourse" /> <form action="${aboutCourse}" method="POST" > <input type='hidden' name='courseId' value=${course.id}/> </form> <a class="btn btn-info" href="${aboutCourse}">Подробнее<c:out value="${course.id}"/></a> By pressing the button, the course.id information should be transmitted to the controller (it is displayed on the page)
@RequestMapping(value = "/aboutCourse", method = RequestMethod.GET) public String aboutCourse( @RequestParam(required = false) long courseId){ CustomCourse course = courseService.getCourseById(courseId); return "aboutCourse"; } But when clicking on the link we get:
There was an unexpected error (type = Internal Server Error, status = 500). It can not be translated as a primitive type. Consider the object wrapper for the corresponding primitive type.
There are opinions why the parameter is not passed, why it wants to assign null and what happens at all?)