通用表单处理程序

     HttpSession session = request.getSession();
                                                 List wherecollection=new ArrayList();
                                                 wherecollection.removeAll(wherecollection);
                                                 Enumeration e = request.getParameterNames();
                                                // if (request.getMethod().equals("POST"))
                                              //  {
                                                    sResult = Constants.
                                                            FAILING;             
                                               
                                                 while (e.hasMoreElements()) {
                                                
                                                     String parameterName = (
                                                             String) e.
                                                                            nextElement();
                                                     String parameterValue = (
                                                             String) request.
                                                                             getParameter(
                                                                                     parameterName);
                                                     System.out.println("参数名称:" +
                                                                        parameterName +
                                                                        "<BR>");
                                                     System.out.println("参数内容:" +
                                                                        parameterValue +
                                                                        "<BR>");
                                                   
                                                     if (checkform(parameterValue,parameterName)==0) {//成功
                                                         addrow(wherecollection,parameterName,parameterValue
                                                               );
                                                     }
                                                 }
原文地址:https://www.cnblogs.com/bobomail/p/262800.html