How do I change my request mapping for dynamic urls? URLs might look like this:
- http://zz.zz.zz.com:8080/webapp/p1/q9/e3/test?Id=2&maxrows=5
- http://zz.zz.zz.com:8080/webapp/a1/b2/c3/test?Id=2&maxrows=5
- http://zz.zz.zz.com:8080/webapp/x1/y2/z3/test?Id=2&maxrows=5
Here's the working controller syntax when the url is in this format:
http://zz.zz.zz.com:8080/webapp/test?Id=2&maxrows=5
@RequestMapping(value = "/test", method = RequestMethod.GET)
public @ResponseBody void test(
@RequestParam(value = "Id", required = true) String Id,
@RequestParam(value = "maxrows", required = true) int maxrows
) throws Exception {
System.out.println("Id: " + Id + " maxrows: " + maxrows);
}