Is there a way to configure @RequestParam for all the API in a class. I want all my API to have a mantory request param like token.
Have you seen the @RequestMapping#params
annotation element?
@RequestMapping
is an annotation that you can put on the top of your controller and then you can provide the required parameter names that need to be present for it to be accessible on your controller:
@RequestMapping(params = { "token" }, ...)
public class MyRequiredTokenEndpoints { ... }