Greetings I want in the index to show the message made in a controller with a background provided by Boostrap. When starting the application the variable message has no content and paints the background of the boostrap.
How do you do it so that it is only painted if you have data?
Index:
<!-- Mensajes -->
<div class="alert alert-info">${mensaje}</div>
<!-- mensajes -->
Controller:
ModelAndView vista = new ModelAndView() ;
vista.setViewName("index");
vista.addObject("mensaje", "Insertado Correctamente");
return vista;
My idea was: But it gives error
<!-- Mensajes -->
<% if (${mensaje} != null)
<div class="alert alert-info">${mensaje}</div>
%>
<!-- mensajes -->