You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Long <ja...@supernovasoftware.com> on 2004/06/03 08:41:37 UTC

Problem --> bean-el:message to format numbers,dates....?

I would like to do the following:
JSP: <bean-el:message key="format.number.2"
arg0="${transSelectForm.priFLC}" /></td>
Resources: format.number.2=Convert {0,number,#########0.00}
 
This fails with the follwing error:
java.lang.IllegalArgumentException: Cannot format given Object as a
Number
I believe this is because it is being passed String rather than a
subclass of Number.
 
Currently I am forced to use this:
JSP: <bean:write name="transSelectForm" property="priFLC"
formatKey="format.decimal.2"/>
Resources: format.decimal.2=#########0.00
 
The following is supposed to work from
http://husted.com/struts/tips/004.html
<bean:message key="ordering.authorized.range.staff" arg0='<%=
config.getStaffAuthAmnt() %>'/>
 
How can I use bean-el:message in this way so that I can support multiple
paramter international message resource use?
 
I found http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11852 that
discusses this problem.  It is marked as RESOLVED, but as WONTFIX.
 
Could some please comment on the status of this and if it will work with
struts-el?
  
Jason Long - CEO and Chief Software Engineer
Supernova Software - supernovasoftware.com
BS Physics, MS Chemical Engineering