Contents
  1. 1. Receive from Request URL Query String
    1. 1.1. Integer Array
    2. 1.2. String Array
  2. 2. Receive from Form Data
    1. 2.1. Integer Array
    2. 2.2. String Array
  3. 3. Receive from request body JSON
    1. 3.1. Integer Array
    2. 3.2. String Array

Receive from Request URL Query String

Integer Array

Frontend Pass with HTTP request

  • url?ids=1,2,3
  • url?ids=1&ids=2&ids=3

Backend receive in controller methods

  • Integer[] ids
  • @RequestParam Integer[] ids
  • @RequestParam List<Integer> ids

String Array

Frontend Pass with HTTP request

  • url?ids=a,b,c
  • url?ids=a&ids=b&ids=c

Backend receive in controller methods

  • String[] ids
  • @RequestParam String[] ids
  • @RequestParam List<String> ids

Receive from Form Data

Integer Array

Frontend Pass with HTTP request

  • ids=1,2,3
  • ids=1, ids=2, ids=3

Backend receive in controller methods

  • Integer[] ids
  • @RequestParam Integer[] ids
  • @RequestParam List<Integer> ids

String Array

Frontend Pass with HTTP request

  • ids=a,b,c
  • ids=a, ids=b, ids=c

Backend receive in controller methods

  • String[] ids
  • @RequestParam String[] ids
  • @RequestParam List<String> ids

Receive from request body JSON

Integer Array

Frontend Pass with HTTP request

  • [1,2,3]

Backend receive in controller methods

  • @RequestBody Integer[] ids
  • @RequestBody List<Integer> ids

String Array

Frontend Pass with HTTP request

  • [“a”,”b”,”c”]

Backend receive in controller methods

  • @RequestBody String[] ids
  • @RequestBody List<String> ids
Contents
  1. 1. Receive from Request URL Query String
    1. 1.1. Integer Array
    2. 1.2. String Array
  2. 2. Receive from Form Data
    1. 2.1. Integer Array
    2. 2.2. String Array
  3. 3. Receive from request body JSON
    1. 3.1. Integer Array
    2. 3.2. String Array