number formatting - JSTL padding int with leading zeros -


i'm trying use jstl build form. have select input months need months 2 digits i.e. padded left 0 1-9.

i have obvious doesn't give me 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 has have been done before can't find example after bit of searching.

found answer: minintegerdigits

<select class="forminput">     <c:foreach var="i" begin="1" end="12" step="1" varstatus ="status">         <option><fmt:formatnumber minintegerdigits="2" value="${i}" /></option>     </c:foreach> </select> 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -