I am trying to use JSTL to create a form. I have a choice for months, but I need months to always be two digits, that is, filled on the left with a zero value for 1-9.
I have this, but it is obvious that he does not give me what I want.
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<select class="formInput">
<c:forEach var="i" begin="1" end="12" step="1" varStatus ="status">
<option><fmt:formatNumber pattern="##" value="${i}" /></option>
</c:forEach>
</select>
This should have been done before, but I canβt find an example after a short search.
source
share