1:我的serveice和dao如下
,如何配置action的自动注入,不用写配置文件的,我用了
<context:component-scan base-package="cn.ajicompany" scoped-proxy="interfaces"></context:component-scan>
但是就是注入不了。
@Repository("customerDao")
public class CustomerDaoImpl extends BaseDaoImpl<Customer> implements CustomerDao {}
@Service("customerService")
public  class CustomerServiceImpl implements CustomerService {
@Autowired
private CustomerDao customerDao;
.....
}
public class loginAction extends ActionSupport {

@Autowired
private CustomerService customerService;

解决方案 »

  1.   

    你那个service里面没写setter getter方法
    @Autowired setter方法上面
      

  2.   

    写了,在junit里面通过getbeans可以正常调试service,但是在action无法注入
      

  3.   

    service实现类里面加这个了吗@Service("xxxxxService")
    然后action里面的service接口取名就为这个xxxxxService
      

  4.   

    都写过了啊,有没有通过注解action,不用配置的实例?求提供一个
      

  5.   

    action 也要交給spring管理,加插件包
      

  6.   

    加了struts2-spring-plugin-2.1.6.jar,急人啊
      

  7.   

    web.xml加<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    <!-- default: /WEB-INF/applicationContext.xml -->
    </listener> <context-param>
    <param-name>contextConfigLocation</param-name>
    <!-- <param-value>/WEB-INF/applicationContext-*.xml,classpath*:applicationContext-*.xml</param-value>  -->
    <param-value>classpath:beans.xml</param-value>
    </context-param>
    还有就是action也要给spring管理