When the foreground uses Ajax to upload multipart/form-data type parameters, the values received by the background are all NULL, for the following reasons:
1, the variable name does not have one by one correspondence.
Solution: Check whether the name uploaded before and background entity names are the same.
2. The following configuration is not added to the spring configuration file:
<id= "Multipartresolver" class= " Org.springframework.web.multipart.commons.CommonsMultipartResolver "></Bean >
Add Maven dependencies at the same time:
1 <Dependency>2 <groupId>Commons-fileupload</groupId>3 <Artifactid>Commons-fileupload</Artifactid>4 <version>1.2.2</version>5 </Dependency>6 <Dependency>7 <groupId>Commons-io</groupId>8 <Artifactid>Commons-io</Artifactid>9 <version>2.5</version>Ten </Dependency>
When Ajax uploads the Multipart/form-data type parameter, the backend cannot receive the solution