Axis2 - Date Format

后端 未结 4 1546
小蘑菇
小蘑菇 2021-02-06 05:00

Scenario

The date format which is output as a response to the Web Service client by Axis2 is formatted as \"2009-08-28+01:00\". I would like to change this to show on

4条回答
  •  星月不相逢
    2021-02-06 05:52

    I had the same problem and it is possible to remove timezone from dates!

    You can use your own created ConvertUtil.

    At first you must create class with your customized convert method/methods:

    public class myConvertUtil extends org.apache.axis2.databinding.utils.ConverterUtil
        {
        public static String convertToString(Date value)
            {
            // return customized Date format
            }
        }
    

    Then you must set this class as SYSTEM_PROPERTY_ADB_CONVERTERUTIL:

    String convert_class = "com.firm.myConvertUtil";
    System.setProperty(ConverterUtil.SYSTEM_PROPERTY_ADB_CONVERTERUTIL, convert_class);
    

提交回复
热议问题