调试:
在前后端debug的过程中发现总是获取不到为空:
在spring-web.xml中配置:
<!-- 文件上传解析器 --> <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>
在pom.xml中加入依赖即可:
<!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload --> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.3.2</version> </dependency>
调试过程中又发现问题,修改如下(shopoperation.js):
继续调试,完成。