• 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

Spring Advisor's

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

I have a question about spring advisor. My project has been configured to use spring framework.
I have a logging advisor configured this way and it works fine

<bean id="loggingInterceptor"
class="gov.osc.spring.LoggingInterceptor" />

<bean id="loggingAdvisor"
class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
<property name="advice">
<ref bean="loggingInterceptor" />
</property>
<property name="pattern">
<value>com\..+Manager(IF)?\..+</value>
</property>
</bean>

To my knowledge we dont have any references to this bean. But it still works fine.
Is spring container smart enough to identify all the advisors when it reads the configuration file and applies the advisor to the beans? or is there any configuration we have to make it work?

Thanks in advance
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sheetal,

As it is working fine for you, so no issues..

Anyways for your knowledge, to invoke an interceptor we should provide the reference for "LoggingInterceptor" in urlMapping bean, like

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="interceptors">
<list>
<ref bean="LoggingInterceptor"/>
</list>
</property>
</bean>
 
I'm still in control here. LOOK at this tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic