我想根据特定的注释使用方面方法。在我的场景中,当我用注释标记我的业务类时@Service
它不起作用,但是当我将它更改为组件时它开始工作。
这是示例:
My Aspect class...
@Aspect
@Component
public class MyAspect
{
....
@Around(value="@annotation(com.myannoation.annotation.MyAnnotate)")
public Object MyMethod(ProceedingJoinPoint proceedingJoinPoint) throws Exception {
return ......
}
.......
@Component-->it is work
@Service -->it is not working
@Path("api/myapisample")
public class myapicontroller {
@POST
@Produces(MediaType.APPLICATION_JSON)
public Response confirm(MyRequest request)
{
.....