I use spring mvc 4.0.2. I defined a class with several boolean properties, such as isSoldout
, autoMergeWhileChoose
. The simplified code as
public class Dish implements Serializable{
private boolean autoMergeWhileChoose = true;
private boolean isNew = false;
private boolean isSpecial = false;
private boolean isSoldOut = false;
......
}
I get the json from client side. I found the properties with is-
prefix have been removed the is-
. For example, isSoldOut
changes to soldOut
. But the other boolean properties without prefix is- don't change. I show a part of the json here
{
...
"autoMergeWhileChoose" : true,
"new" : false,
"soldOut" : false,
"special" : false
...
}
You can find the first autoMergeWhileChoose
does not change, but the following three are changed without the prefix is-
.
The convertor is MappingJackson2HttpMessageConverter
, and the config file is
<beans:bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
<beans:property name="messageConverters">
<beans:list>
<beans:bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<beans:property name="prettyPrint" value="true"/>
</beans:bean>
</beans:list>
</beans:property>
</beans:bean>
Are there some settings to deal with it?