how to get param in method post spring mvc?

后端 未结 4 1888
执笔经年
执笔经年 2020-11-29 23:59

I\'m using spring mvc. And I can\'t get param from url when method = post. But when I change method to GET, so I can get all param.

This is my form:

         


        
4条回答
  •  执念已碎
    2020-11-30 00:26

    1. Spring annotations will work fine if you remove enctype="multipart/form-data".

      @RequestParam(value="txtEmail", required=false)
      
    2. You can even get the parameters from the request object .

      request.getParameter(paramName);
      
    3. Use a form in case the number of attributes are large. It will be convenient. Tutorial to get you started.

    4. Configure the Multi-part resolver if you want to receive enctype="multipart/form-data".

      
          
      
      

    Refer the Spring documentation.

提交回复
热议问题