• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Doubt in Annotation Aspect

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using annotation to add aspects to my programs. I declared a class and annoted it, to make it as an aspect class i.e added @Aspect annotation before class declaration and other advice annotations (eg. @Before, @AfterReturning) before the methods. To make this aspect to work, I have also added <aop:aspectj-autoproxy/> in the Spring configuration xml. But still my aspects are not working.

<aop:aspectj-autoproxy/> is not detecting my aspect class.

It works only when I add a bean of my aspect class type in spring configuration xml. Is this correct behaviour? Please correct me if it is wrong.


Thanks,
G. Kamal.
 
Ranch Hand
Posts: 607
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's how it supposed to work. For auto detection of class you need to add
 
kamalakannan kamal
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya, when i added, it works. Thanks Sam.
 
    Bookmark Topic Watch Topic
  • New Topic