Hello Guys,
I'm running the latest version of MG:3 and I'm trying to apply AOP
advice to my controllers. I'm not completely sure if this is even
possible but thought I'd show you what I've got so far in the hope
someone can point me to if/what I'm missing.
I'm trying to apply some beforeAdvice to my CompanyController, the
controller is defined within the modelglue.xml like so:
<controller id="CompanyController"
type="controller.CompanyController" beans="CompanyService">
Now, from within the ColdSpring.xml I'm trying to apply the advice
like so:
<bean id="CompanyControllerTarget" class="controller.Company" />
<bean id="CompanyController"
class="coldspring.aop.framework.ProxyFactoryBean">
<property name="target">
<ref bean="CompanyTarget" />
</property>
<property name="interceptorNames">
<list>
<value>securityAdvisor</value>
</list>
</property>
</bean>
<bean id="securityAdvice"
class="aop.security.securityBeforeAdvice" />
<bean id="securityAdvisor"
class="coldspring.aop.support.NamedMethodPointcutAdvisor">
<property name="advice">
<ref bean="securityAdvice" />
</property>
<property name="mappedNames">
<value>*</value>
</property>
</bean>
Now, I don't think there is anything wrong with the ColdSpring config
itself but I'm pretty sure that MG inst using my CompanyController
bean from ColdSpring, it's generating it itself and this is why the
advice is not being applied.
Can anyone offer me some suggestions on this? Like I say, perhaps I'm
trying to achieve the unachievable but I'm hoping I can apply thse
advice to the controllers as well as the model.
Cheers all,
Rob
--~--~---------~--~----~------------~-------~--~----~
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
-~----------~----~----~----~------~----~------~--~---