Tag Archives: String

Spring MVC upload file error string cannot be converted to multipartfile

Recently, I encountered a type receiving error when uploading with springmvc. The input tag of file type is set in the JSP form, but an error is reported when receiving with multipartfile in springmvc, which roughly means that string convert multipartfile has an error. Finally, I know that I am using form submission. The enctype attribute in the form must be set to enctype = “multipart/form data”, Because only this attribute means that the file file is uploaded, and I didn’t write it

The enctype in the form has three attributes: 1. Application/x-www-form-urlencoded. 2、multipart/form-data。   3、text/plain

1: Encode all characters before encoding, including special characters, convert spaces to “+” symbols, and special characters to ASCII hex values. It is also the default setting for form

2: No character encoding. This value must be used when using a form containing a file upload control, and the file will be read in a binary stream

3: Spaces are converted to a “+” plus sign, but special characters are not encoded

 

[Solved] Error:java: error: release version 5 not supported & Switch Unrecognized String

 

There will be such a problem when importing project and build from other places

At present, the local is openjdk11.0.2

Change the idea configuration as follows

File > Settings

If STR in switch is string type, the following two parts should be changed:

File > project structure

However, when the POM changes and rebuilds, the above three settings will automatically change back to the default settings, so the & lt; project> Add the Maven compiler plugin plug-in, and specify the JDK version to be used by JDK (I currently use openjdk 11.0.2, and I find that it’s OK to directly configure an 11, and the settings in the above three places will automatically change to the 11 option)

<build>
<plugins>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.7.0</version>
    <configuration>
        <source>11</source>
        <target>11</target>
    </configuration>
</plugin>
</plugins>
</build>