title: (Spring MVC) How to retrieve multiple objects from Rest API
body: <p>I'm currently using angularJS as my front end, and I'm passing in REST calls to spring MVC to delete multiple objects</p>
  
  <p>In my angular function, I have a method that will return
  "localhost:9000/api/departments/deleteSelectedDepartments/1517,1518"</p>
  
  <pre><code>   deleteSelectedDepartments(selectedDepartments: any): Observable&lt;ResponseWrapper&gt; {
  
      var id = "";
      var index = 0;
  
      for(const key in selectedDepartments) {
          if(index == (Object.keys(selectedDepartments).length - 1)) {
              id += key;
          } else {
  
              id += key;
              id += ",";
          }
          index++;
      }
  
      return this.http.delete(`${this.resourceDeleteDepartmentsUrl}/${id}`);
  }
  </code></pre>
  
  <p>1517 and 1518 represents the department IDs.</p>
  
  <p>However, I"m receiving errors in my Spring MVC and I'm not entirely sure how to properly receive the object.</p>
  
  <p>Currently in my DepartmentResource.java (spring mvc)</p>
  
  <pre><code>@DeleteMapping("/departments/deleteSelectedDepartments/{ids}")
  @Timed
  public ResponseEntity&lt;Void&gt; deleteSelectedDepartments(@PathVariable String ids) {
      log.debug("REST request to delete Department : {}", ids);
      return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, "blank")).build();
  }
  </code></pre>
  
  <p>The error message I'm getting is error 404 not found.</p>
  
  <pre><code>DELETE http://localhost:9000/api/departments/deleteSelectedDepartments/1589,1590 404 (Not Found)
  </code></pre>
  
  <p>If there is a better way to go about doing things, please advise! Thank you!</p>