after enctype=“multipart/form-data” request not working

后端 未结 4 2019
你的背包
你的背包 2021-01-13 09:40

public class Relay extends HttpServlet {   
    @Override
    public void service(HttpServletRequest request, HttpServletResponse response)
    throws Servl         


        
4条回答
  •  佛祖请我去吃肉
    2021-01-13 10:16

    I am including this just for additional information for troubleshooting. if you are stuck and want to know about what all parameters are coming through multipart request you can print all parameters using following code.

    MultipartRequest multi =   
    
    Enumeration en1 = multi.getParameterNames();
            while (en1.hasMoreElements()) { 
                String strParamName = (String)en1.nextElement(); 
                String[] strParamValues = multi.getParameterValues(strParamName); 
    
                for (int i = 0; i < strParamValues.length; i++) { 
                System.out.println(strParamName + "=" + strParamValues[i]); 
                } 
    
            }
    

提交回复
热议问题