You have a TypeMismatch Exception because you are trying to bind String
(the request parameter is String) to Integer
.
You just need to parse its value to get an int, use Integer.parseInt()
:
Feedback feedback = new Feedback();
if(request.getParameter("radios") != null) {
feedback.setMark(Integer.parseInt(request.getParameter("radios")));
}
And add name="radios"
to yours select
:
<form:select class="form-control" name="radios" path="mark" >
<c:forEach begin="1" end="10" var="i" >
<option value="${i}">${i}</option>
</c:forEach>
</form:select>
chŝdk
source
to share