2 comments

@Abby Howe 2020-05-22 23:50:30

You might try using the conditional like this

<div class="alert alert-danger alert-dismissible" th:if="${errormessage}">
     <button type="button" class="close" data-dismiss="alert">&times;</button>
          <strong th:text="${errormessage}">Success!</strong> 
</div>

Then in your controller method signature use RedirectAttributes redirectAttributes with your redirectAttribute message.

redirectAttributes.addFlashAttribute("successmessage", "Add message here")

@SorcererApprentice 2020-05-20 14:45:20

You have to remember to set to false the error attribute.

@Beata 2020-05-20 17:22:04

I already tried that but it doesn't work. Page doesn't refresh.

Related Questions

Sponsored Content

Sponsored Content