HTTP Status 500 - Unable to instantiate Action, customerAction, defined for ‘CustomerAction_list’ in namespace ‘/’customerAction
1.在applicationContext.xml中没有开启注解(如果是xml注解配置,无需开启)
<context:annotation-config/>
2.或者没有
<context:context-scan/>
注解说明
• 注册注解处理器
• 方式一:bean
<bean class="org.springframework.beans.factory.annotation.
AutowiredAnnotationBeanPostProcessor"/>
• 方式二: 命名空间 <context:annotation-config/>
<context:annotation-config />将隐式地向Spring
容器注册AutowiredAnnotationBeanPostProcessor、CommonAnnotationBeanPostProcessor
、 PersistenceAnnotationBeanPostProcessor
以及RequiredAnnotationBeanPostProcessor 这4 个BeanPostProcessor 。
• 方式三: 命名空间<context:component-scan />
如果要使注解工作,则必须配置component-scan ,实际上不需要再配置annotation-config。 base-package
属性指定了需要扫描的类包,类包及其递归子包中所有的类都会被处理。还允许定义过滤器将基包下的某些类纳入或排除。

3212

被折叠的 条评论
为什么被折叠?



