I am using Spring MVC RequestMapping here for GET parameters. Below is my code -
@RequestMapping(value = "index", method = RequestMethod.GET)
public HashMap<String, String> handleRequest(@RequestParam("dc1Servers") String dc1Servers, @RequestParam("dc2Servers") String dc2Servers, @RequestParam("dc3Servers") String dc3Servers) {
HashMap<String, String> model = new HashMap<String, String>();
String helloWorld = "Hello World!";
model.put("greeting", helloWorld);
System.out.println(dc1Servers);
System.out.println(dc2Servers);
System.out.println(dc3Servers);
return model;
}
I am hitting this URL - http://127.0.0.1:8080/dataweb/index?dc1Servers=3&dc2Servers=3&dc3Servers=3 then it goes into the above code and prints out 3 on the console for all the print and works fine.
Now if you see, I have dc1, dc2 and dc3.
So for dc1, I would like to send these in the URL as the parameters-
dc1Servers=3
dc1HostA
dc1HostB
dc1HostC
dc1IPAddresssA
dc1IPAddresssB
dc1IPAddresssC
Similarly for dc2, I would like to send these in the URL as the parameters-
dc2Servers=3
dc2HostA
dc2HostB
dc2HostC
dc2IPAddresssA
dc2IPAddresssB
dc2IPAddresssC
Similarly for dc3, I would like to send these in the URL as the parameters-
dc3Servers=3
dc3HostA
dc3HostB
dc3HostC
dc3IPAddresssA
dc3IPAddresssB
dc3IPAddresssC
Now I am not sure how would I construct an URL for this use case and how would my method will look like? I would like to send them in one single URL call.
Is this use case possible to do using Spring MVC?