I need to add a Html content when some method returns the wanted result (any method, any result) to the JSF page exactly like primefaces do with .
Html to add is simple :
<div class="alert alert-success" role="alert">
<strong>Well done!</strong> You successfully read this important alert message.
</div>
But can't find a way to do this cleanly, I've read many posts like How do I return HTML from managed bean in JSF? but my bean need to insert that html when user is doing something e.g. submitting a form result.
Also : is there a way to save it and show it in case of a redirection like it is with primefaces context.getExternalContext().getFlash().setKeepMessages(true);