【发布时间】:2018-02-01 04:56:42
【问题描述】:
完整的错误是:
处理器执行期间出错 'org.thymeleaf.spring4.processor.attr.SpringInputGeneralFieldAttrProcessor' (搜索:12)
当我有我的 search.html 页面时显示:
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<!--<meta charset="UTF-8">-->
<title>Search Users</title>
</head>
<body>
<h3>Search Users</h3>
<form th:action="@{/user/search}" th:object="${searchCriteria}" method="post">
<p>First Name: <input type="text" value="*{firstname}"/></p>
<p>Last Name: <input type="text" value="${searchCritera.lastname}"/></p>
<br/>
<input type="submit" value="search"/>
</form>
</body>
</html>
但我随后将value 更改为th:field 为*{firstname} 和${searchCritera.lastname},如下所示:
<form th:action="@{/user/search}" th:object="${searchCriteria}" method="post">
<p>First Name: <input type="text" th:field="*{firstname}"/></p>
<p>Last Name: <input type="text" th:field="${searchCritera.lastname}"/></p>
<br/>
<input type="submit" value="Search"/>
</form>
现在我收到上面的错误,似乎无法修复它。我尝试了th:value,但它引发了另一个错误:
评估 SpringEL 表达式的异常:“searchCritera.lastname” (搜索:12)
【问题讨论】: