Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java spring aop仅适用于特定方法_Java_Spring Aop - Fatal编程技术网

Java spring aop仅适用于特定方法

Java spring aop仅适用于特定方法,java,spring-aop,Java,Spring Aop,我们需要在我们的项目中实现SpringAOP。在spring配置中是否有任何方法只需要应用aop 一些具体的方法? 例如:我只需要通过SpringAOP对以“create”开头的方法初始化一些变量。例如:createEmployee(雇员); 在spring中不使用aspectJ就可以实现吗? 清楚吗?或者我应该多解释一下?我该怎么做?我可以对配置应用某种过滤器吗?是的,可以这样做 <tx:advice id="transactionAdvice" transaction-manager=

我们需要在我们的项目中实现SpringAOP。在spring配置中是否有任何方法只需要应用aop 一些具体的方法? 例如:我只需要通过SpringAOP对以“create”开头的方法初始化一些变量。例如:createEmployee(雇员); 在spring中不使用aspectJ就可以实现吗?
清楚吗?或者我应该多解释一下?我该怎么做?我可以对配置应用某种过滤器吗?

是的,可以这样做

<tx:advice id="transactionAdvice" transaction-manager="hibernateTxManager">
        <tx:attributes>        
            <tx:method name="create*" read-only="false" propagation="REQUIRED" />            
        </tx:attributes>
    </tx:advice>