どのようにJSPでのforループを使用してループチェックボックスに?

vidy:

私は、forループを使用してループチェックボックスにしようとしています。私が書くc:forEachのチェックボックスをループします。チェックボックスは、データベース内のデータフィールドごととして表示されます。私はこれらのチェックボックスのいずれかをチェックしようとする。しかし、一つだけのチェックボックスをチェックします。何が私がここで間違っているのでしょうか?

チェックボックス

<c:forEach items="${brandlist}" var="brand" begin="0" end="5"
    varStatus="loop">
    <div class="custom-control custom-checkbox">
        <input type="checkbox" class="custom-control-input" id="customCheck1"
            name="brand"> <label class="custom-control-label" for="customCheck1">${brand.brand}</label>
    </div>
</c:forEach>

なぜ唯一のチェックボックスがチェックされていますか?

vidy:

私の問題は、追加した後に解決しました

<c:forEach items="${brandlist}" var="brand" begin="0" end="5"
varStatus="loop">
<div class="custom-control custom-checkbox">
    <input type="checkbox" class="custom-control-input"
        id="${brand.brand}" name="${brand.brand}"> <label
        class="custom-control-label" for="${brand.brand}">${brand.brand}</label>
</div>

おすすめ

転載: http://43.154.161.224:23101/article/api/json?id=217764&siteId=1