• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt in Annotation Aspect

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ya, when i added, it works. Thanks Sam.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic