tar*_*xgg 9 html java spring thymeleaf
我尝试加载时遇到解析错误localhost:8080/
.
我在模板中找不到任何错误,为什么我会犯这个错误?
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Mon Apr 20 16:59:56 EEST 2015
There was an unexpected error (type=Internal Server Error, status=500).
Exception parsing document: template="index", line 26 - column 3
Run Code Online (Sandbox Code Playgroud)
<tr th:each="customer : ${customers}">
<td th:text="${customer.identity}">001</td>
<td th:text="${customer.name}">Name</td>
<td th:text="${customer.address}">Address</td>
<td th:text="${customer.age}">Age</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
public String mainPage(Model model){
ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
PersonJDBCTemplate personJDBCTemplate = (PersonJDBCTemplate) context.getBean("personJDBCTemplate");
List<Person> persons = personJDBCTemplate.getAllPersons();
model.addAttribute("customers", persons);
return "index";
}
Run Code Online (Sandbox Code Playgroud)
Far*_*ook 17
可能是你错过了某处的结束标签.我不知道你在HTML模板中有什么,除非你发布完整的代码.
但是用这个模板替换你当前的文件.它应该工作.然后,您可以添加丢失的代码.
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head lang="en"></head>
<body>
<tr th:each="customer : ${customers}">
<td th:text="${customer.identity}">001</td>
<td th:text="${customer.name}">Name</td>
<td th:text="${customer.address}">Address</td>
<td th:text="${customer.age}">Age</td>
</tr>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
28699 次 |
最近记录: |