I've encountered a possible bug in the use of formatKey in <bean:write>. As
always it's more likely to be my error but I'd appreciate it if anyone could
have a look. I'm running the latest nightly build of struts.

Code snippets are below but to summarise, I'm using the <bean:write> tag and
formatKey attribute in my JSP to refer to 3 different format keys in my
resource file. However all my values are being formatted using the
format.dollars key if the resource file entries are as below. If I remove
format.dollars then I get the strings formatted as percentages, etc. I.e.
only one format string is ever used. All my properties return datatype
"double" which I assume is something to do with the problem but I'm not sure
what. Why can't I format 4 different properties in 4 different ways using 4
different format keys?

Thanks,
Matt.

In a JSP file I have this snippet:

<logic:iterate id="item" name="player" property="portfolio">
        <tr>
                <td><bean:write name="item" property="desc" /></td>
                <td><bean:write name="item" property="quantity" /></td>
                <td><bean:write name="item" property="value" formatKey="format.dollars"
/></td>
                <td><bean:write name="item" property="totalStrength"
formatKey="format.int" /></td>
                <td><bean:write name="item" property="totalDefense" 
formatKey="format.int"
/></td>
                <td><bean:write name="item" property="change"
formatKey="format.percentage" /></td>
        </tr>
</logic:iterate>

In my ApplicationResource.properties file I have this snippet:

format.int=0
format.dollars=$0.00
format.percentage=0.00%


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to