java - 添加删除选项后,我开始收到错误 500
问题描述
添加删除选项后,我在添加新对象后立即开始收到错误 500,不知道为什么。
我检查了所有标签是否都已关闭,它们是。eclipse没有指出错误。
HTML:
<div class="container">
<div th:each="lembrete : ${lembretes}">
<form method="post">
<div class="postIt">
<input type="text" class="titu" name="nome" th:value="${lembrete.nome}">
<a class="btn" th:href="${(#mvc.url('EC#deletarLembrete').arg(0, lembrete.id)).build()}">x</a>
<textarea class="txta" cols="30" name="descr" th:text="${lembrete.descr}"></textarea>
<button class="btn2" type="submit">salvar</button>
</div>
</form>
</div>
</div>
爪哇:
@Controller
public class LembreteController {
@Autowired
private LembreteRepository lr;
@RequestMapping("/deletarLembrete")
public String deletarLembrete(long id) {
Lembrete lembrete = lr.findById(id);
lr.delete(lembrete);
return "redirect:/eventos";
}
}
错误(我认为重要的部分):
org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/index.html]")
Caused by: org.attoparser.ParseException: Exception evaluating SpringEL expression: "(#mvc.url('EC#deletarLembrete').arg(0, lembrete.id)).build()" (template: "index" - line 27, col 21)
Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "(#mvc.url('EC#deletarLembrete').arg(0, lembrete.id)).build()" (template: "index" - line 27, col 21)
Caused by: java.lang.IllegalArgumentException: Mapping not found: EC#deletarLembrete
There was an unexpected error (type=Internal Server Error, status=500).
An error happened during template parsing (template: "class path resource [templates/index.html]")
解决方案
推荐阅读
- stm32 - STM32 uart转发
- keras - 使用条件和查找的自定义激活函数
- javascript - TypeError:firebaseApp.auth 不是函数
- r - 为 GLMM ZI NB 计算 R 中的 Pearson 残差
- javascript - 反应原生:setState 没有立即更新
- symfony - OroPlatform:如何实现 FileType
- android - 为什么 Gradle 插件构建失败而不是 `./gradlew` 构建?
- python - Pymongo find_one 返回空列表
- azure - 您如何访问已部署的 AppService webapp 中的文件?
- alloy - 在合金分析仪中保持相同的索引?