'How to do a get request to SpringBoot java with an Array<Array<string>>?
I am doing a get request in angular with typescript and here it is:
this.http.get("http://localhost:8080/data-management/data-users/getAllGeneralInfoCV/"+this.listAllCharacteristicsToFind);
The attributte "listAllCharacteristicsToFind" is an Array<Array<string>>
. For example, in this case, listAllCharacteristicsToFind[0] will be an array of two strings: [B2,C1]. I have in the controller in Java with SpringBoot this method:
@GetMapping("data-users/getAllGeneralInfoCV/{listAllCharacteristicsToFind}")
public List<DataCV2> getAllGeneralInfoCV(@PathVariable ArrayList<ArrayList<String>> listAllCharacteristicsToFind){
System.out.println(listAllCharacteristicsToFind);
return findUserDataCVService.findAllGeneralCV(listAllCharacteristicsToFind.get(0),listAllCharacteristicsToFind.get(1), listAllCharacteristicsToFind.get(2), listAllCharacteristicsToFind.get(3), listAllCharacteristicsToFind.get(4), listAllCharacteristicsToFind.get(5));
}
In the system.out.println I can see that the array it gets to the controller is [[B2], [C1], [], [], [], [], []]. However, it should be [[B2, C1], [], [], [], [], []]. In Angular it is okey, so what's the problem?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|