I have scenario where one url "serachUser" may come with two different value (request parameter) userId or UserName.
so for this I have created two methods
public String searchUserById(@RequestParam long userID, Model model)
public ModelAndView searchUserByName(@RequestParam String userName)
But i am getting Ambiguous mapping found exception. Spring has any way to handle this situation.
Best Answer
You can use the
params
parameter to filter by HTTP parameters. In your case it would be something like: