How about changing the injection to the constructor? There is no use to those resolvers (`NoCacheResolver` & `WebPathResolver`) without the request. This would also remove duplicate code of this check.