Вопрос

I need to append a ":00" value with the below code output in my jsp page.

<s:iterator begin="0" end="23" status="stat">
   <option ><s:property value="%{#stat.index}" ></s:property></option>
</s:iterator>

the above code gives 0,1,2,... upto 23, but i need the output as 0:00 1:00 2:00... etc.

please help me

Это было полезно?

Решение

Try this:

<s:iterator begin="0" end="23" status="stat">
   <option ><s:property value="%{#stat.index}" ></s:property>:00</option>
</s:iterator>

I simply added ":00" string in front of the s:property tag.

Другие советы

You can use

<option> <s:property value="%{#stat.index}"/> :00</option>

for your purpose.

So why you want check condition here?

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top