i want to show my error message from controller to html thymleaf spring boots
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 !");
开发者_Python百科 return "redirect:/save-product";
}
<div th:if="${errorMessage}">
<div th:text="${errorMessage}"></div>
</div>
This is my Controller and my div show error message to thymleaf but this one can't show on my thymleaf page
addFlashAttribute() Modify to addAttribute()
精彩评论