开发者

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()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜