In the form tag, enctype is used to mark the MIME encoding format, multipart/form-data is the encoding format for file uploading, and the default is application/x-www-form-urlencoded, which cannot be used for file uploading.
Therefore, a form with enctype="multipart/form-data" format will report a null pointer exception when request.getParameter gets the value of the text attribute in the background.
So in an item that has both a textfield and a file upload is my workaround is:
The getFieldName in the class is to get the name attribute value of the input, getString is to get the value value, put these two values into a map and then get it through the key.
The corresponding jar packages are: commons-email - 1.5.jar , commons-fileupload - 1.3.3.jar , commons-io-2.5.jar , mail.jar