We are having a input filter for the REST APIs. The inputs are validated in this filter and then chain.doFilter(req,res) will redirect it to the API where the logic of the API is executed.
Can someone help me on how I can redirect the control to a different API from input filter if there is invalid input. Want to make this validation generic so adding it in input filter.