Search code examples
springgrails

How to add tx:annotation-driven to grails


I'm trying to enable aspectJ in a grails 2.4.3 project. Sources on internet usually explain for spring.

They suggest adding

<tx:annotation-driven mode="aspectj"/>

How can we add this to a grails project?


Solution

  • The equivalent of <tx:annotation-driven mode="aspectj"/> will be something like this in grails-app/conf/spring/resources.groovy:

    xmlns tx:"http://www.springframework.org/schema/tx"
    tx.'annotation-driven'(mode:'aspectj')