异常评估 SpringEL 表达式:"date_a" 在可在其他 3 个页面上运行的代码上

Exception evaluating SpringEL expression: "date_a" on code that works on 3 other pages

我对这段代码有疑问...

<form action="#" th:action="@{'/portfolio/' + ${portfolios.getId()} + '/old' }" th:object="${Date}" method="post">
<table>
    <tr>
        <td>From: <input type="date" th:value="*{date_a}" th:field="*{date_a}" /></td>
    </tr>
    <tr>
        <td><input type="submit" th:onclick="'javascript:loading()'" value="Change day" /></td>
    </tr>
</table>

我真的不明白为什么这不起作用... 它从其他页面复制粘贴,其中有 3 个页面,所有其他页面都可以使用相同的代码段。但是这里我得到错误。

org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "date_a" (template: "portfolio" - line 12, col 42)

我在上一页传递了一个空对象

ThymeDate date = new ThymeDate();
modelAndView.addObject("Date", date);

编辑:

百里香日期

@Entity
 @Table(name = "dto_thyme")
 public class ThymeDate implements Serializable {

@Id
@GeneratedValue
long id;

@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate date_a;

@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate date_b;

public long getId() {
    return id;
}

public void setId(long id) {
    this.id = id;
}

public LocalDate getDate_a() {
    return date_a;
}

public void setDate_a(LocalDate date_a) {
    this.date_a = date_a;
}

public LocalDate getDate_b() {
    return date_b;
}

public void setDate_b(LocalDate date_b) {
    this.date_b = date_b;
}

public ThymeDate() {

}

public ThymeDate(LocalDate date_a, LocalDate date_b) {

    this.date_a = date_a;
    this.date_b = date_b;
}

}

我仍然不知道这是关于保留关键字还是类似的... 将表单对象名称从 Date 更改为 ThymeDate,现在可以了吗?

如果有人有更好的解释,我可以接受它作为答案...