You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Joshua McCulloch <co...@yahoo.com> on 2002/11/22 20:43:11 UTC

i18n, resource bundles, ...

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
doesn�t work because arg0 is a String.
<bean:message key="submit.price" arg0="1234.56"/>

I haven�t 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
won�t 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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: disabling cookies in IE6.0

Posted by James Mitchell <jm...@telocity.com>.
Hi Chris, that's a tough one.

Try my home page:
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=how+to+disable+cookies+in
+ie6



--
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: Chris Ruegger [mailto:cruegger@speakeasy.net]
> Sent: Sunday, November 24, 2002 7:39 PM
> To: Struts Users Mailing List
> Subject: disabling cookies in IE6.0
>
>
> I can't find the panel in IE6.0 to disable cookies.
> How do I turn of cookies with this version
> of the browser? I want to test URL
> re-writing.
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


disabling cookies in IE6.0

Posted by Chris Ruegger <cr...@speakeasy.net>.
I can't find the panel in IE6.0 to disable cookies.
How do I turn of cookies with this version
of the browser? I want to test URL
re-writing.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: i18n, resource bundles, ...

Posted by Antoni Reus <an...@wanadoo.es>.
Hi, take a look at

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11852


A Divendres 22 Novembre 2002 21:16, Joshua McCulloch va escriure:
> That shouldn't be any different than
> <bean:message key="submit.price" arg0="1234.56"/>
>
> I forgot to mention the exception occuring with that
> statement. It looks like the magic happening in the
> java.text.* classes with a {0,number,currency}
> argument requires a java.lang.Number.
>
> org.apache.jasper.JasperException: Cannot format given
> Object as a Number
> 	at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
>248) at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
>
>
> <...etc...>
>
> root cause
>
> java.lang.IllegalArgumentException: Cannot format
> given Object as a Number
> 	at
> java.text.NumberFormat.format(NumberFormat.java:204)
> 	at java.text.Format.format(Format.java:116)
> 	at
> java.text.MessageFormat.format(MessageFormat.java:737)
> 	at
> java.text.MessageFormat.format(MessageFormat.java:486)
> 	at java.text.Format.format(Format.java:116)
>
> --- James Mitchell <jm...@telocity.com> wrote:
> > > 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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: i18n, resource bundles, ...

Posted by Joshua McCulloch <co...@yahoo.com>.
That shouldn't be any different than 
<bean:message key="submit.price" arg0="1234.56"/>

I forgot to mention the exception occuring with that
statement. It looks like the magic happening in the
java.text.* classes with a {0,number,currency}
argument requires a java.lang.Number.

org.apache.jasper.JasperException: Cannot format given
Object as a Number
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
	at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)


<...etc...>

root cause

java.lang.IllegalArgumentException: Cannot format
given Object as a Number
	at
java.text.NumberFormat.format(NumberFormat.java:204)
	at java.text.Format.format(Format.java:116)
	at
java.text.MessageFormat.format(MessageFormat.java:737)
	at
java.text.MessageFormat.format(MessageFormat.java:486)
	at java.text.Format.format(Format.java:116)

--- James Mitchell <jm...@telocity.com> wrote:
> > 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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: i18n, resource bundles, ...

Posted by James Mitchell <jm...@telocity.com>.
> 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:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>