No matching editors or conversion strategy foundsession
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.namecode
还有一点,表单采用域模型,字段采用e.name 方式引用, e为 Action里面实体Emp的对象e <s:textfield name="e.name"></s:textfield>