It contains a method
@RequestMapping**(value = “application/{clientId}”)**
public String showClientDetails(@PathVariable(“clientId”) Integer clientId, ModelMap model) {
…
return “/module/oauth2/registration”;
}
When I send a URL : localhost:8080/openmrs/module/oauth2/application/2 or any integer
I get a HTTP 404 error and the following message :
The page “/openmrs/module/oauth2/application/2” cannot be found. Check the link and try again.
Could you point me in the right direction to resolve this?
At a glance, I suspect that the * in your class-level RequestMapping is the problem. My understanding is that the RequestMapping value from the class and the method are just concatenated together so you’re ending up with a RequestMapping for “/module/oauth2/*application/{clientId}”, but you actually want to get rid of the * so you get “/module/oauth2/application/{clientId}”
Here is an example from the REST Web Services module that uses class-level + method-level RequestMappings, along with a PathVariable