I've just started to use spring boot for my services. I have few controllers that use same code in their bodies. for example in every controller I have to check if request object obtained from request is null or not:
if (request == null){
throw new InvalidRequestException("the request object is null");
}
I know that repeating code in several controllers is not a good approach, so I was wondering if there is a way to prevent code repetition, or if spring boot has a solution for the mentioned problem.