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=pri开发者_C百科ce;
}
}
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.
Do you have your struts.properties set?
Example:
struts.locale=en_US
struts.i18n.encoding=UTF-8
struts.properties
精彩评论