request getParameter is always null when using enctype=“multipart/form-data”

前端 未结 2 1772
孤城傲影
孤城傲影 2020-12-04 02:47

I am performing validation of inputted data such as email, password, name, etc. But I am already stuck on the first stage of validation which is to check if User entered not

2条回答
  •  醉梦人生
    2020-12-04 03:09

    Since it is a multipart/form-data (usually used for the puropose of uploading one/more file(s)) form the request.getParameter() method will always return null.

    You can try

     

    Or completely remove the enctype parameter.

    Some references in another SO question.

    How to upload files to server using JSP/Servlet?

提交回复
热议问题