Get all parameters from JSP page

后端 未结 6 1366
无人共我
无人共我 2020-12-01 03:33

I have n number of text fields named in the form \"Question.....\". How can I get all the parameters which starts with \"question\" from the JSP page to the Action?

6条回答
  •  时光说笑
    2020-12-01 04:17

    HTML or Jsp Page         
    
    
    
    
    and so on...
    in java Code 
    
     SortedSet ss = new TreeSet();
     Enumeration enm=request.getParameterNames();
    while(enm.hasMoreElements())
    {
        String pname = enm.nextElement();
        ss.add(pname);
    }
    Iterator i=ss.iterator();
    while(i.hasNext())
    {
        String param=(String)i.next();
        String value=request.getParameter(param);
    }
    

提交回复
热议问题