aspose file tools*
The moose likes Java in General and the fly likes Plz help: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Plz help: "wrong format string" error" Watch "Plz help: "wrong format string" error" New topic
Author

Plz help: "wrong format string" error

Charles Richardson
Greenhorn

Joined: Apr 28, 2004
Posts: 8
I've newly inherited responsibility for a legacy, Struts-based, Java web-app that's used internationally. All of our U.S. clients have no trouble at all but we have a client in Germany who gets the following error. I've Google'd the error message and most of what I find seems to suggest an Internationalization error, talking about JSTL as a possible solution but, frankly, I already feel like I'm in over my head.

I don't know enough about Java (and virutally nothing about Struts) to know whether I should've posted this question in the Struts area or here, or elsewhere? Any help at all from you kind folks would be greatly appreciated. My Java skill level is probably best categorized as 'beginner' so please keep that in mind when you answer; the less you assume that I know, the better for me :-)

Thanks VERY MUCH in advance for all help!

Richard



type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Wrong format string: '###,###,###,###,###,###,###,###,###,###,###,##0.00'
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.cts.site.siteContentView_jsp._jspService(siteContentView_jsp.java:163)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
com.myims.strutscore.struts.controller.ControllerServlet.process(ControllerServlet.java:73)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.myims.utils.servlet.SessionExpireFilter.doFilter(SessionExpireFilter.java:43)


root cause

javax.servlet.jsp.JspException: Wrong format string: '###,###,###,###,###,###,###,###,###,###,###,##0.00'
org.apache.struts.taglib.bean.WriteTag.formatValue(WriteTag.java:376)
org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:292)
org.apache.jsp.cts.site.siteContentView_jsp._jspx_meth_bean_write_1(siteContentView_jsp.java:257)
org.apache.jsp.cts.site.siteContentView_jsp._jspx_meth_tiles_put_0(siteContentView_jsp.java:209)
org.apache.jsp.cts.site.siteContentView_jsp._jspService(siteContentView_jsp.java:132)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
com.myims.strutscore.struts.controller.ControllerServlet.process(ControllerServlet.java:73)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.myims.utils.servlet.SessionExpireFilter.doFilter(SessionExpireFilter.java:43)


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.30 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.0.30
David Brossard
Ranch Hand

Joined: Jun 03, 2004
Posts: 109
If we're talking numbers, the right format for German numbers is as follows:

one thousand two hundred and three dollars and thirty three cents would be

1.203,33

whereas the US one would be

1,203.33

Please note that putting the "dot as a thousand marker" convention in continental Europe is not always followed strictly (it's common to ommit it when one writes)


No matter what they say in Ohio, we're still first in flight!
Charles Richardson
Greenhorn

Joined: Apr 28, 2004
Posts: 8
Originally posted by David Brossard:
If we're talking numbers, the right format for German numbers is as follows:

one thousand two hundred and three dollars and thirty three cents would be

1.203,33

whereas the US one would be

1,203.33

Please note that putting the "dot as a thousand marker" convention in continental Europe is not always followed strictly (it's common to ommit it when one writes)


Hello, David. Thank you for your timely reply.

I do realize that the comma and period are different in Germany than in the U.S. (guess I should have said so initially; my bad).

What I don't realize is how to get the codebase to adapt to its environment automatically. This application (code) is used by U.S. clients as well as European (with other countries soon to follow) and I can't fathom that there isn't some mechanism in Java, or Struts, to look at the locale of the client and assign/use the correct format string?

Surely there must be (?) a way to write code that gets its formatting from local or regional settings automatically? Or am I idealistic and naive about all this?

Thanks again for your reply, David; I do appreciate it. I do apologize for not being clearer initially. I hope my additional clarification, above, has helped narrow down the emphasis of my problem as well as what I'm after.
[ September 26, 2006: Message edited by: richard harlos ]
 
 
subject: Plz help: "wrong format string" error