, (, 0833888999) ( , ), .
You can use Type Conversion to convert to / from the desired format - and use the google library you mentioned. Something like the following might get you started (in short, to get the gist of it):
public class MyConverter extends StrutsTypeConverter {
public Object convertFromString(Map context, String[] values, Class toClass) {
String phoneNr = values[0]
MyPhoneObject phone = googleLibrary.doYourMagic(phoneNr);
return phone;
}
public String convertToString(Map context, Object o) {
googleLibrary.parseString( ((MyPhoneObject)o).rawPhoneNr() );
}
}
Do not forget to register the converter in xwork-conversion.properties
my.PhoneObject=path.to.MyConverter
source
share