com.book.struts.action.LoginAction.setCustomerService(customerService);

解决方案 »

  1.   

    private ICustomerService customerService;public ICustomerService getICustomerService(){
    return customerService;
    }
    public void setICustomerService(ICustomerService customerService){
    this.customerService=  customerService;
    }
    public ActionForward execute(
    没错啊。
      

  2.   

    name 属性是不是指注入的<bean id="">
    bean 属性是指com.book.struts.action.LoginAction里具体的对象 ICustomerService customerService;
      

  3.   

    name理论上可以随便取,只要与LoginAction中的setter方法同名就可以了
    现在提倡对接口编程,就是最好用功能类的抽象类来作为name
    bean就是bean了,一般是spring里面的bean,如果在你定义的配置文件中的bean
    就可以用local关键字了浅薄的理解,请参考,错误,请指正
      

  4.   

    在com.book.struts.action.LoginAction这个类里面没有找到cutomerService这个对象的set方法.其实二楼已经很明白的说了啊public void setICustomerService(ICustomerService customerService){
    this.customerService=  customerService;
    }把你这个setICustomerService 里面的"I"去掉 Spring的注入是根据set方法来注入的,不是根据对象名来注入的
      

  5.   

    ...e  怎么get方法也有个I...汗..请问LZ用的IDE是什么..如果是eclipse的话有自动生成get set 方法..应该不会犯这种低级错误啊..
      

  6.   

    public void setICustomerService(ICustomerService customerService){
    this.customerService=  customerService;
    }
    你把I去掉试试