Reputation: 6620
I have the following textfield which shows the value 50,000,000 of the variable as 5.0E7,
I know I can format it using fmt
tag, but the problem is that I am using Struts2 iterator and I can not use the fmt
inside the textfield.
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<s:iterator value="products.items" var="item" status="cursor">
<s:textfield id="price" name="products.items[%{#cursor.index}].price"
value="<fmt:formatNumber value="%{price}" />
Upvotes: 1
Views: 1423
Reputation: 1
Use fmt
tag in the body of the struts tag. The body of the tag contains a value in the string form.
<s:textfield id="price" name="products.items[%{#cursor.index}].price">
<fmt:formatNumber value="${price}"/>
</s:textfield>
Upvotes: 2