Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用格式化程序在SpringMvc JSON中格式化JodaTime LocalDate_Json_Spring_Format_Jodatime - Fatal编程技术网

使用格式化程序在SpringMvc JSON中格式化JodaTime LocalDate

使用格式化程序在SpringMvc JSON中格式化JodaTime LocalDate,json,spring,format,jodatime,Json,Spring,Format,Jodatime,我的Spring应用程序有问题。 如何在JSON中格式化LocalDate。 问题是,当我发送JSON时,我必须发送一个数字,但当Spring生成JSON时,我有: "data": { "weekyear": 1970, "weekOfWeekyear": 1, "chronology": { "zone": { "fixed": true, "id": "UTC" } },

我的Spring应用程序有问题。
如何在JSON中格式化
LocalDate

问题是,当我发送JSON时,我必须发送一个数字,但当Spring生成JSON时,我有:

"data": {
    "weekyear": 1970,
    "weekOfWeekyear": 1,
    "chronology": {
        "zone": {
            "fixed": true,
            "id": "UTC"
        }
    },
    "monthOfYear": 1,
    "yearOfEra": 1970,
    ...and a lot more
我的字段带有注释
DateTimeFormat
,如:

@DateTimeFormat(pattern="dd/MM/yyyy")
private LocalDate data;
并在my
servlet context.xml中配置了格式服务:

<beans:bean id="conversionService" class="org.springframework.format.support.FormattingConversionServiceFactoryBean">
 </beans:bean>

但单凭这一点是不行的,我错过了什么配置