坑之Pointcut is not well-formed: expecting 'name pattern' at character position异常

来源:互联网 发布:网络不安全怎么解决 编辑:程序博客网 时间:2024/05/22 03:31

配置aop报错:原因是配置切点表达式的时候报错了:

切点表达式配置方法:

切入点表达式的使用规则:

execution(modifiers-pattern? ret-type-pattern declaring-type-pattern? name-pattern(param-pattern) throws-pattern?)

有“?”号的部分表示可省略的,modifers-pattern表示修饰符如publicprotected等,ret-type-pattern表示方法返回类型,declaring-type-pattern代表特定的类,name-pattern代表方法名称,param-pattern表示参数,throws-pattern表示抛出的异常。在切入点表达式中,可以使用*来代表任意字符,用..来表示任意个参数。

<aop:config proxy-target-class="false">
        <aop:aspect ref="corletPointCutTest">
            <aop:pointcut id="allRenderProcess"
                expression="execution(* com.hsbc.esf.requestprocessing.portlet.impl.PortletFrontController.doRenderService(..)) || execution(* com.hsbc.esf.requestprocessing.portlet.impl.PortletFrontController.processRenderRequest(..))||execution(* com.hsbc.esf.requestprocessing.portlet.impl.PortletFrontController.doActionService(..))" />
         <aop:before  method="checkPorletPoint" pointcut-ref="allRenderProcess"/>
        </aop:aspect>

    </aop:config>    


<aop:config>       <aop:advisor advice-ref="txAdvice"pointcut="execution(* com.taotao.content.service.*.*(..))" /></aop:config>


注意星号后面要有个空格,一定要有空格,要空格,空格!!!!!

阅读全文
0 0
原创粉丝点击