title: Is it impossible to have a @RequestParam as a List?
body: <p>I have a controller like this:</p>
  
  <pre><code>@RequestMapping(value="/selectTimeSpaceBusRunList.do")
  public ModelAndView selectTimeSpaceBusRunList(Model model, HttpServletRequest request,
          @RequestParam("search_date") String search_date,
          @RequestParam(value="compid", required=false, defaultValue="") String compid,
          @RequestParam(value="routeid", required=true) String routeid,
          @RequestParam(value="busList", required=true) List&lt;String&gt; busList)
  {
      ModelAndView mv = new ModelAndView();
      Map&lt;String, List&lt;TbDmhTmspaceChartVO&gt;&gt; resultMap = new HashMap&lt;String, List&lt;TbDmhTmspaceChartVO&gt;&gt;();
  
      try {
          TbDmhTmspaceChartVO vo = new TbDmhTmspaceChartVO();
          search_date = search_date.replaceAll("-", "");
          vo.setSearch_start_date(search_date + "000000");
          vo.setSearch_end_date(search_date + "235959");
          vo.setCompid(compid);
          vo.setRouteid(routeid);
          vo.setBusList(busList);
          List&lt;TbDmhTmspaceChartVO&gt; resultList = runService.selectTimeSpaceBusRunList(vo);
          resultMap.put("resultList", resultList);
      } catch (Exception e) {
          logger.error("##selectTimeSpaceBusRunList exception " + e.toString());
      }
      mv.addAllObjects(resultMap);
      mv.setViewName("jsonView");
      return mv;
  }
  </code></pre>
  
  <p>And I have VO like this:</p>
  
  <pre><code>public class TbDmhTmspaceChartVO {
  private String run_enddt;       //  date                yes     1   
  private String busid;           //  number(9,0)         yes     2   
  private String run_startdt;     //  date                yes     3   
  private String routeid;         //  number(9,0)         yes     4   
  private String compid;          //  number(6,0)         yes     5   
  private String carregno;        //  varchar2(12 byte)   yes     6   
  private String runord;          //  number(4,0)         yes     7   
  private String start_pathseq;   //  number(5,0)         yes     8   
  private String end_pathseq;     //  number(5,0)         yes     9   
  private String total_bstopcnt;  //  number(10,0)        yes     10  
  private String seq_list;        //  varchar2(4000 byte) yes     11  
  private String node_list;       //  varchar2(4000 byte) yes     12  
  private String hms_list;        //  varchar2(4000 byte) yes     13  
  private String coll_list;       //  varchar2(4000 byte) yes     14  
  private String cross_pass_cnt;  //  number(10,0)        yes     15  
  private String seq_list_1;      //  varchar2(4000 byte) yes     16  
  private String node_list_1;     //  varchar2(4000 byte) yes     17  
  private String hms_list_1;      //  varchar2(4000 byte) yes     18  
  private String coll_list_1;     //  varchar2(4000 byte) yes     19  
  private String bstop_dep_cnt;   //  number(10,0)        yes     20  
  private String seq_list_3;      //  varchar2(4000 byte) yes     21  
  private String node_list_3;     //  varchar2(4000 byte) yes     22  
  private String hms_list_3;      //  varchar2(4000 byte) yes     23  
  private String coll_list_3;     //  varchar2(4000 byte) yes     24  
  
  private String search_start_date;
  private String search_end_date;
  
  private List&lt;String&gt; busList;
  
  // getters and setters...
  public List&lt;String&gt; getBusList() {
      return busList;
  }
  public void setBusList(List&lt;String&gt; busList) {
      this.busList = busList;
  }
  }
  </code></pre>
  
  <p>For the data I am sending is:</p>
  
  <pre><code>busList: ["7211342", "7015067"]
  compid: "166001"
  routeid: "165000056"
  search_date: "2017-11-06"
  </code></pre>
  
  <p>My ajax Call is like this:</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "./run/selectTimeSpaceBusRunList.do",
      data: {
          search_date : input_date,
          compid : $("#busCompany").val(),
          routeid : $("#busRoute").val(),
          busList : selected_bus_list
      },
      dataType : "json",
      beforeSend: null,
      success: success,
      error: null
  });
  </code></pre>
  
  <p>When the ajax Call is done, it ends with error like this:</p>
  
  <pre><code>org.springframework.web.bind.MissingServletRequestParameterException: Required List parameter 'busList' is not present
  </code></pre>
  
  <p>So there must be problem with <code>@RequestParam(value="busList", required=true) List&lt;String&gt; busList)</code>, but I could not find the solution with it.</p>
  
  <p>My question is:</p>
  
  <ol>
  <li>Is it impossible to get <code>List</code> variable with <code>@RequestParam</code>?</li>
  <li>If it is impossible, is there other way to get <code>List</code> variable?</li>
  <li>Is it possible to get DTO variable at once?</li>
  </ol>
  
  <p>Regards,</p>
  
  <hr>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I changed the <code>@RequestParam(value="busList", required=true) List&lt;String&gt; busList)</code> into <code>@RequestParam(value="busList", required=false) List&lt;String&gt; busList)</code>, and now it works fine. So I think the problem lies with <code>busList</code> not being sent in a right way.</p>