views:

48

answers:

1

Hi.

I'm using java beans with automatic data transfer and type conversion. Ex:

public class MyAction
{
  public String execute(){
//   ....
  }

private double price;
public getPrice(){
   return price;
}

public setPrice(double price){
  this.price=price;
}
}

Let my request to be http://localhost:8080/my.action?price=21.3 Then in the setPrice I'll get price variable value equal to 213. I thing this occur because of the romanian culture set. In this cultures double are presented as 21,3 and not 21.3 as in the others. In .NET there is something called as InvariantCulture for this cases. How can I do something similar in Struts and where should be this settings specified.

+1  A: 

Do you have your struts.properties set?

Example:

struts.locale=en_US
struts.i18n.encoding=UTF-8

struts.properties

Trick