日期:2014-05-18 浏览次数:20736 次
public class PaymentAction
@Autowired
protected MyecService myecService; (不为NULL)
这个类里面有个方法通过反射创建对象 简单工厂方法
Platform platform = Factory.createPlatform(paymentTypeNo);
platform.returnMessageHandle(request, response, paymentTypeNo);
创建的具体是Wzt类的对象
@Service
public class Wzt extends PlatformPayment implements Platform {
@Autowired
protected MyecService myecService; (NULL)
配置文件自动扫描,wzt在service包下
<!-- Anontation @Component scan... -->
<context:annotation-config />
<context:component-scan base-package="com.**.action" />
<context:component-scan base-package="com.**.service.**"/>