在applicationContext配置文件中添加1
2
3
4
5
6
7
8
9
10
11<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="java.lang.String">
<bean class="org.springframework.beans.propertyeditors.StringTrimmerEditor">
<constructor-arg name="emptyAsNull" value="true"/>
</bean>
</entry>
</map>
</property>
</bean>
spring mvc将空字串转换成null配置
您的支持将鼓励我继续创作!