wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts 2 + Number format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 + Number format" Watch "Struts 2 + Number format" New topic
Author

Struts 2 + Number format

Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688



Hello every one,

I am using Struts 2.0 . In my application when I chose browser language German "de" and work with decimal number and submit form if increase one zero.

like if I submit 3.01 and submit and update it converts 30.01.

In German it decimal number looks like 3,01.

It use comma instead of dot.

So how to format my number at Jsp page when browser is German.

Please reply ASAP

Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Which version?

IIRC there was a bug for this that was resolved; I can't find it in JIRA at the moment though so I'm not sure.
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688


Hello David ,

What you excellently want to say.

Please explain with more description. I am not getting. My problem is with German language browser.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'm saying I believe there was a bug that caused this behavior, and I believe it was fixed. That's why I asked what version you're using.

I can't *find* the bug in the bug database, so I don't know for certain.
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688

Thanks David,


I am using Mozila Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6

and struts 2.0

And by the way which version you are talking about ? Browser or Struts.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Struts.

You should see if you can find the bug report in the Struts 2 JIRA; I looked a little bit this morning but couldn't find it.
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688


Thanks David,

SO, Tell me what I have suppose to do ?

This application is basically for our German client so we have to give them to solution for this bug.

Give some sol. for this is you have any ......



David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Either update to a version of S2 that includes the bug fix or find the bug fix and patch whatever version of Struts you're using.

Searching further, I found this:

https://issues.apache.org/struts/browse/WW-2176

It doesn't look like it's been fixed, although I think the bug is actually in XWork rather than Struts.

If that's the case, another workaround would be to use a custom type converter rather than relying on the XWork one (again, if it isn't really fixed--have you tried the same thing in a recent version? For some reason you won't tell me what version you're using so I can't really try a more recent version, since I don't know what a "more recent version" would be).
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688


Thanks a lot David for your reply,

By the way we are using Bundle-Version: 2.1.2 of Struts .


So, If you get something please tell us.


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I don't know what else to tell you; the S2 ticket is still open, if you need further information I'd try looking at other S2 tickets or see if there's an XWork ticket for the same issue. I provided you with an irritating workaround if the bug is still open.
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688


Thanks David your best reply.

Thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2 + Number format