How to scan classes for annotations?

前端 未结 7 2060
野性不改
野性不改 2020-12-28 17:00

I have a plain jane servlets web application, and some of my classes have the following annotations:

@Controller
@RequestMapping(name = \"/blog/\")
public cl         


        
7条回答
  •  醉梦人生
    2020-12-28 18:03

    Instead of using reflection directly, you can make a lot easier for you by using AOP libraries from Google Guice. AOP is a common way for implementing cross-cutting concerns of an application, such as logging/tracing, transaction handling or permission checking.

    You can read more about it here: https://github.com/google/guice/wiki/AOP

提交回复
热议问题