再整合ssh时,关于Spring IOC注入问题

No matching editors or conversion strategy found


IOC问题:
EmpService bean 实现了 Iemp接口,就不能直接作为参数传入Action里面;
要将Iemp接口作为对象参数传入Action,然后在Action引用接口对象里面的方法。
Spring 容器 接口要引用EmpService实现类。


<bean id="emp" class="pojo.Emp"/>

<bean id="empAction" class="action.EmpAction">
   <property name="iemp" ref="empService"></property>
   <property name="e" ref="emp"/>
</bean>
 
 <bean id="empService" class="service.EmpService">
    <property name="sessionFactory" ref="sessionFactory"></property>
 </bean>
 
</beans>

not-null property references a null or transient value: pojo.Emp.name

还有一点,表单采用域模型,字段采用e.name 方式引用, e为 Action里面实体Emp的对象e 
  <s:textfield name="e.name"></s:textfield>

猜你喜欢

转载自www.cnblogs.com/zhaocundang/p/9822540.html