You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "James A. Hillyerd" <ja...@activerain.com> on 2004/07/06 20:41:35 UTC

bean:write throws "Wrong format string"

I'm having a problem rendering a number using the bean write tag, I'm 
using Struts 1.1.

This is the offending JSP code:

<bean:write name="l" property="lp" formatKey="format.integer"/>

Here is the format entry in my appliation.resources:

format.integer=###,###,###,##0

This is the exception that gets logged:

2004-07-05 12:21:34 StandardWrapperValve[default]: Servlet.service() for 
servlet default threw exception
javax.servlet.jsp.JspException: Wrong format string: '###,###,###,##0'
         at 
org.apache.struts.taglib.bean.WriteTag.formatValue(WriteTag.java:376)
         at 
org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:292)

The strange part is that this particular JSP page always works for me, 
but I still see a large number of exceptions in my logfile.  When I 
compare the time of the exception to my access log, I see that the 
people that trigger the exception are coming from other locales (such as 
China).

My application is not localized, and since it's a site that lists US 
homes for sale, I don't plan to make alternate language versions anytime 
soon!

How can I fix this?

Thanks!

-james

-- 
James A. Hillyerd <ja...@activerain.com>
http://www.activerain.com/

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


Re: bean:write throws "Wrong format string"

Posted by Bill Siggelkow <bi...@bellsouth.net>.
You might want to look into the JSTL formatting tags. They handle 
locales quite well.

James A. Hillyerd wrote:

> I'm having a problem rendering a number using the bean write tag, I'm 
> using Struts 1.1.
> 
> This is the offending JSP code:
> 
> <bean:write name="l" property="lp" formatKey="format.integer"/>
> 
> Here is the format entry in my appliation.resources:
> 
> format.integer=###,###,###,##0
> 
> This is the exception that gets logged:
> 
> 2004-07-05 12:21:34 StandardWrapperValve[default]: Servlet.service() for 
> servlet default threw exception
> javax.servlet.jsp.JspException: Wrong format string: '###,###,###,##0'
>         at 
> org.apache.struts.taglib.bean.WriteTag.formatValue(WriteTag.java:376)
>         at 
> org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:292)
> 
> The strange part is that this particular JSP page always works for me, 
> but I still see a large number of exceptions in my logfile.  When I 
> compare the time of the exception to my access log, I see that the 
> people that trigger the exception are coming from other locales (such as 
> China).
> 
> My application is not localized, and since it's a site that lists US 
> homes for sale, I don't plan to make alternate language versions anytime 
> soon!
> 
> How can I fix this?
> 
> Thanks!
> 
> -james
> 


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