使用commons request得不到值为null解决方案

<bean id="multipartResolver"                       
      class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
		<property name="defaultEncoding" value="utf-8"></property>
		<property name="maxUploadSize" value="20971520"></property>
		<property name="maxInMemorySize" value="20971520"></property>
</bean>

如果request.getParameter("xx") 得到的值为null,那么需要在web层的配置文件中加上这个commsMultipartResolver处理器才可以接受得到。

由于CommonsMultipartResolver  还是使用的是commons-fileUpdate 来处理请求 所以还需要导入fileUpdate  的jar包 

猜你喜欢

转载自blog.csdn.net/Demo1109/article/details/88878085