N
N
nuclear_kote2018-04-16 17:44:36
Java
nuclear_kote, 2018-04-16 17:44:36

Why doesn't Conditional work on RestController?

@Component
@RestController
@Conditional(ExmplCondition.class)
@RequestMapping(value = "/api/users")
public class RestController extends AbstractRestController {
...
}

public class ExmplCondition implements Condition {


    @Override
    public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) {
        return false;
    }

}

matches is not called at all

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question