Error creating dynamic form with thymeleaf

0

The form receives a list and creates fields to be filled

<form action="#" th:object="${questoes}" method="POST" th:action="@{/testar}">
            <div class="form-group" th:each="item, questao : ${questoes}">
                <input type="hidden" th:value="${item.id}" th:field="*{questoes[__${questao.index}__].id}" />
                <input class="form-control" type="text" th:field="*{questoes[__${questao.index}__].resposta}" />
            </div>
            <button type="submit">s</button>
        </form>

But it produces the result:

  

org.springframework.beans.NotReadablePropertyException: Invalid   property 'questoes [0]' of bean class [java.util.ArrayList]: Bean   property 'questoes [0]' is not readable or has an invalid getter   method: Returns the type of the getter match the parameter type of   the setter?

    
asked by anonymous 27.07.2018 / 02:26

0 answers