Recent comments

Spring mvc Parte 7 Configurando Fecha y Status JSTL

1.- Agregamos el tag fmt para la fecha
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<td>
<fmt:formatDate value="${pelicula.fechaEstreno}" pattern="dd-MM-yyyy" />
</td>

2.- Agregamos un condifional en status:

<td>
<c:choose>
<c:when test="${pelicula.status=='Activa'}">
<span class="badge-success"> Activa</span>
</c:when>
<c:otherwise>
<span class="badge-danger"> Inactiva</span>
</c:otherwise>
</c:choose>
</td>

No hay comentarios.