Answer the question
In order to leave comments, you need to log in
How to debug/debug annotations in Java?
Annotated code is found in many libraries (for example, in Spring). But I don't understand how to debug it?
After all, you can put a breakpoint in a method or even a class field and go through the calls. It is clear what goes where.
And cases with annotations so far are a dark forest for me. You can’t put a breakpoint there, so I can’t understand step by step how they work. Therefore, an unexplored piece of the application remains. How to be? How to debug such code?
Answer the question
In order to leave comments, you need to log in
Is it me or do you really not understand what annotations are? An annotation by itself does nothing. It only marks classes/methods/fields/parameters. These annotations are processed by spring. It understands that if a class is marked with the @Controller annotation, then it is a controller and it will look for request handler methods in this class, which, for example, are marked with the @RequestMapping annotation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question