您的位置:首页 > 其它

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

2017-09-28 09:58 661 查看
配置aop报错:原因是配置切点表达式的时候报错了:

切点表达式配置方法:
切入点表达式的使用规则:execution(modifiers-pattern? ret-type-pattern declaring-type-pattern? name-pattern(param-pattern) throws-pattern?)有“?”号的部分表示可省略的,modifers-pattern表示修饰符如public、protected等,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>


注意星号后面要有个空格,一定要有空格,要空格,空格!!!!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐