Spring Boot:可编辑列表

时间:2018-10-17 17:11:19

标签: java spring-boot arraylist thymeleaf

我想显示和更改对象列表(预订)。但是我收到以下错误:

SELECT * FROM devices WHERE tags.[[group]].name = 'beta1'

获取方法:

org.thymeleaf.exceptions.TemplateProcessingException: Error during execution of processor 'org.thymeleaf.spring5.processor.SpringInputGeneralFieldTagProcessor'

HTML网站:

@RequestMapping(value="/buchen", method=RequestMethod.GET)
    public String buchen(Model model) {

        List<Buchung> buchungen = buchungRepository.findAll();  
        model.addAttribute("buchungen",buchungen);                      
        return "buchung"; 
}

当我显示列表时,我没有任何错误。我可以轻松编写:

<form action="#" th:action="@{/buchen}" th:object="${buchung}" method="post">
    <table class="table table-striped">
    <thead>
    <tr>
    <th>Menge</th>
    </tr>
    </thead>
    <tbody>     
    <tr th:each = "buchung : ${buchungen}">
    <td ><input type="number" th:field="${buchung.guests}" ></td>
    </tr>
    </tbody>
    </table>
    <p><input type="submit" value="Submit" /> </p>
    </form>

但是我也需要更改列表。而且我确信问题与POST方法无关,因为HTML页面根本没有出现。

0 个答案:

没有答案