Could we create the same GET URI but with different query parameters?
For example, I have two REST GET URIs:
/questions/ask/?type=rest
/questions/ask
You can not have two getters with same uri but different request parameters. What you can do is to have one getter method with many request parameters.
@RequestMapping(value = "uri", method = RequestMethod.GET)
public String test(@RequestParam String type, @RequestParam String byUser)
then call it with two parameters
/questions/ask/?type=rest&byUser=john
You have to handle the logic inside test method to handle these parameters accordingly.
Regarding Darijan, I think that it is up to to decide to go with two methods or one method considering what the underline logic is. If you are going with 2 methods then use two uri. If the business logic is ok to go with one uri then use the way I answered