//=========================== 情形一: ===============================
//在网络上传递User1类对象时info属性值在网络的另一端能够接收到!
public class User1 implements Serializable {
public String info = null;
public String userName = null;
public String userPWD = null;
}
//============================ 情形二: ===============================
public class BaseInfo {
public String info = null;
}
//在网络上传递User2类对象时info属性值在网络的另一端接收的值总是null!
public class User2 extends BaseInfo implements Serializable {
public String userName = null;
public String userPWD = null;
}
//============================ 情形三: ===============================
public class BaseInfo2 implements Serializable {
public String info = null;
}
//在网络上传递User2类对象时info属性值在网络的另一端接收得到info的值!
public class User3 extends BaseInfo2 implements Serializable {
public String userName = null;
public String userPWD = null;
}
//**就是不知道子类已经实现了序列化,为什么父类也一定要实现序列化才能够在网络上传输呢?**
原因是没有写get set,springmvc反射设置属性没法设置
spring mvc 处理pojo传递对象时该对象继承父类的属性在网络接收端接收该属性值总是null,why?
原文:https://www.cnblogs.com/yuhuameng/p/11293754.html