For example, when looking at workflow instances list, where a workflow instance's label2 value is null, browser will alert: "DataTables warning: table id=instancesTable - Requested unknown parameter 'label2' for row 0. For more information about this error, please see http://datatables.net/tn/4"
As the telekom-workflow-example runtime environment contains a GSON library (and doesn't contain Jackson libraries) then Spring MVC 4 configures the default GsonHttpMessageConverter, which contains a default Gson instance, where serializeNulls=false. Thus all null values are stripped from the response JSON.
It's not affecting our real application, because we use Jackson libraries and thus Spring uses Jackson message converter.
CORRECT FIX:
1) Remove Spring 3 support classes, like GsonHttpMessageConverterForSpring3.
2) Re-configure (or plug in a new instance) the Springs message converter. One way:
@Configuration
class WebMvcConfiguration extends WebMvcConfigurationSupport {
@Override
protected void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
for (HttpMessageConverter converter : converters) {
if (converter instanceof GsonHttpMessageConverter) {
Gson gson = new GsonBuilder().serializeNulls().create();
((GsonHttpMessageConverter)converter).setGson(gson);
}
}
}
}
For example, when looking at workflow instances list, where a workflow instance's label2 value is null, browser will alert: "DataTables warning: table id=instancesTable - Requested unknown parameter 'label2' for row 0. For more information about this error, please see http://datatables.net/tn/4"
As the telekom-workflow-example runtime environment contains a GSON library (and doesn't contain Jackson libraries) then Spring MVC 4 configures the default GsonHttpMessageConverter, which contains a default Gson instance, where serializeNulls=false. Thus all null values are stripped from the response JSON.
It's not affecting our real application, because we use Jackson libraries and thus Spring uses Jackson message converter.
CORRECT FIX: 1) Remove Spring 3 support classes, like GsonHttpMessageConverterForSpring3. 2) Re-configure (or plug in a new instance) the Springs message converter. One way: