I have two projects, the first (not my project) contains classes that can't be defined as IsSerializable classes.
The second one (my project) uses some of the classes from the first project, and in this case I need to send objects between server side and client side, so they need to be IsSerializable.
My aproach was to obviously extend the original classes and make the "sub" class IsSerializable. but this seems not to be working.
some example:
- Code: Select all
/////////Original class
public class City implements {
private String name;
public City(String name)
{
this.name = name;
}
public City()
{ }
public String getName()
{ return name; }
}
//Class to extend the original one
public class Cidade extends City implements IsSerializable{
public Cidade(String name)
{ super(name); }
public Cidade()
{ }
}
then on the server side I create an object of type Cidade and send it to the client. I can get the object, only with all its contents null.
Can someone confirm me that this can't be made? If so, what am I doing wrong and how to fix this. I wouldn't really like to be copying the full classes from the first project.
Thank you very much.