webservice可以返回的list<T>,t是多态存在的么?

解决方案 »

  1.   

    我表达的不够清楚假如A父类,B,C是A的子类
    public interface MyService {

    List<A> getList();
    }public class MyServiceImpl implements MyService{

    public List<A> getList()
    {  List<A> list=new ArrayList<A>();
    A b=new B();
    A c=new C();
    list.add(b);
    list.add(c);return list;
       
    }
    }
    对应.aegis.xml文件
    <?xml version="1.0" encoding="UTF-8"?>
    <mappings> <mapping>
    <method name="getList">
    <return-type componentType="A"></return-type>
    //如何写,可以支持多态的返回类型
    </method>
    </mapping>
    </mappings>我通过WebService得到的值中没有B,C类型,只是A,如何得到的
      

  2.   

    你得到A强制转化称B,C不行吗?