There is a checkbox set in jstl:

<c:forEach var="type" items="${types}"> <label class="checkbox"><input value="${type}" type="checkbox" name="type">${type}</label> </c:forEach> 

It is necessary with the help of the servlet and jstl in the answer to show what checkbox the user has marked when sending the form. That is, make checked those that the user noted.

    1 answer 1

    Use c:if to check for equality of the user value and the value of the type variable. If it matches, input with checked is output; if not, without it. If there are several user values, it is necessary to check if the current value of the type variable is among them.