Agregar esto al ppio (para usar fn:length)
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
despues se utiliza asi (notar "gt" en vez de > )
<c:if test="${fn:length(companies) gt 0}">
<p>It is greater than 0</p>
</c:if>
si solo queremos ver si esta vacio
<c:if test="${empty companies}">
si queremos IF-ELSE
<c:choose>
<c:when test="${condition}">
//this will be executed when condition is true
</c:when>
<c:otherwise>
//this will be executed when condition is false
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${production eq 0}">
lo que sea que represente produccion == 0
</c:when>
<c:when test="${production eq 1}">
lo que sea que represente produccion == 1
</c:when>
<c:otherwise>
y si no es cualquiera de esos, entonces esto
</c:otherwise>
</c:choose>
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c' %>
esto hay que ponerlo para que nos tome ${VARIABLE}, o sea las objetos que agregamos a los ModelAndView
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // 2014-10-10
SimpleDateFormat humanFormat = new SimpleDateFormat("dd/MM/yyyy"); //10/10/2014
SimpleDateFormat fullFormat = new SimpleDateFormat("d 'de' MMMM", new Locale("ES")); // 15 de Enero de 2015
SimpleDateFormat hora12Format = new SimpleDateFormat("hh:mm:ss"); // 06:10:20 para las 18:10
SimpleDateFormat hora24Format = new SimpleDateFormat("HH:mm:ss"); // 18:10:20
/* Algunos ejemplos
"yyyy.MM.dd G 'at' HH:mm:ss z" 2001.07.04 AD at 12:08:56 PDT
"EEE, MMM d, ''yy" Wed, Jul 4, '01
"h:mm a" 12:08 PM
"hh 'o''clock' a, zzzz" 12 o'clock PM, Pacific Daylight Time
"K:mm a, z" 0:08 PM, PDT
"yyyyy.MMMMM.dd GGG hh:mm aaa" 02001.July.04 AD 12:08 PM
"EEE, d MMM yyyy HH:mm:ss Z" Wed, 4 Jul 2001 12:08:56 -0700
"yyMMddHHmmssZ" 010704120856-0700
"yyyy-MM-dd'T'HH:mm:ss.SSSZ" 2001-07-04T12:08:56.235-0700
"yyyy-MM-dd'T'HH:mm:ss.SSSXXX" 2001-07-04T12:08:56.235-07:00
"YYYY-'W'ww-u" 2001-W27-3
*/
jstl.jsp
<!-- esto para formatear en jsp con jstl -->
<!-- agregar esto al ppio -->
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!-- y luego se podra hacer algo como esto -->
<fmt:formatDate pattern="dd/MM/yyyy" value="${item.FECHA}" />
<fmt:formatDate pattern="HH:mm" value="${item.HORADESDE}" />
<!-- mas info
http://www.tutorialspoint.com/jsp/jstl_format_formatdate_tag.htm
-->