struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Mitchell" <jmitc...@telocity.com>
Subject RE: i18n, resource bundles, <bean:message/>...
Date Fri, 22 Nov 2002 19:59:45 GMT
> it won't compile, its expecting a java.lang.String:

try this...

 <bean:message key="submit.price"
               arg0="<%= new Double("1234.56").toString() %>"/>



--
James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org

"If you were plowing a field, which would you rather use? Two strong oxen or
1024 chickens?"
- Seymour Cray (1925-1996), father of supercomputing


> -----Original Message-----
> From: Joshua McCulloch [mailto:cocoonjosh@yahoo.com]
> Sent: Friday, November 22, 2002 2:43 PM
> To: struts-user@jakarta.apache.org
> Subject: i18n, resource bundles, <bean:message/>...
>
>
> Can someone please help me understand how to use
> arguments for <bean:message/> ?
>
> I have an ApplicationResource with the following
> message:
>
> submit.price=It costs {0,number,currency}!
>
> How can I display that from a JSP? The following
> doesnt work because arg0 is a String.
> <bean:message key="submit.price" arg0="1234.56"/>
>
> I havent used JSP tags much.
> http://husted.com/struts/tips/004.html shows the
> following syntax: <bean:message
> key="ordering.authorized.range.staff" arg0='<%=
> config.getStaffAuthAmnt() %>'/>
> I tried arg0="<%= new Double("1234.56") %>" and it
> wont compile, its expecting a java.lang.String:
>
> C:\tomcat\work\Standalone\localhost\josh\submit_jsp.java:134:
> setArg0(java.lang.String) in
> org.apache.struts.taglib.bean.MessageTag cannot be
> applied to (java.lang.Double)
>           _jspx_th_bean_message_11.setArg0( new
> Double("1234.56") );
>
> What am I doing wrong?
>
> THANKS!
> - Josh
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus  Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> --
> To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message