java - Addition in Struts2 JSP -
if number less 10 want print 01,02,etc. otherwise is. i'm trying below code. problem displays 1,2,etc. partial code.
<s:set var="cnt" value="1" /> <s:set var="total" value="1" /> <s:set value="0" var="keypattern"/> <s:set var="cnt1" value="10" /> <s:iterator begin="1" end="%{itotalweeks}"> <s:iterator begin="1" end="7"> <s:if test='(#cnt-weekstartday+1)<#cnt1'> <s:set var="day" value='%{#keypattern+(#cnt-weekstartday+#total)}'/> </s:if> <s:else> <s:set var="day" value="%{(#cnt-weekstartday+1)}"/> </s:else> <s:set var="cnt" value="%{#cnt + 1}"/> </s:iterator> </s:iterator>
where 'weekstartday' action variable. if set
<s:set value="'0'" var="keypattern"/>
then print 001,011,etc.
Comments
Post a Comment