这是的applicationContext.xml AOP部分:Spring AOP的表达
<bean id="logHandler" class="demo.anderson.aop.LogHandler"></bean>
<aop:config>
<aop:aspect id="log" ref="logHandler">
<aop:pointcut id="addLog" expression="execution(* demo.anderson.controller.StudentController.*(..)) || execution(* demo.anderson.controller.ScoreController.*(..))" />
<aop:before method="beforeLog" pointcut-ref="addLog" />
<aop:after method="afterLog" pointcut-ref="addLog" />
</aop:aspect>
</aop:config>
它的工作!
但是当我配置AOP:切入点是这样的:
<aop:pointcut id="addLog" expression="execution(* demo.anderson.controller.*.*(..))" />
它的分解:
18月 - 2017年11:06:39.416严重[HTTP-NIO-8090-exec- 71] org.apache.catalina.core.StandardContext.listenerStart异常 发送上下文初始化事件监听器 类的实例org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException:电子rror 使用名称创建bean 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Bean初始化失败;嵌套异常是 java.lang.IllegalStateException:预期的原始类型形式 org.springframework.web.servlet.handler.AbstractHandlerMethodMapping $匹配 .................... .........................................引起 通过:java.lang.IllegalStateException :预期的原始类型表格 org.springframework.web.servlet.handler.AbstractHandlerMethodMapping $匹配 ............................. ................................
2017年7月18日11:06:39.434资讯[http- nio-8090-exec-71] org.apache.catalina.core.ApplicationContext.log关闭Spring根目录 WebApplicationContext
有人可以告诉我为什么吗?什么是正确的配置?
Thx用于回答,但它是一样的,控制器包中没有子包。 其他建议? –