if(checkcode.isPresent()){
redirectAttributes.addFlashAttribute("errorMessage", "This products have already !");
return "redirect:/save-product";
} else if (checkname.isPresent()) {
redirectAttributes.addFlashAttribute("errorMessage", "This product have already !");
return "redirect:/save-product";
}
<div th:if="${errorMessage}">
<div th:text="${errorMessage}"></div>
</div>
这是我的控制器和我的div显示错误信息给thymleaf但是这个不能显示在我的thymleaf页面
addFlashAttribute()修改为addAttribute()