public class Person {
private String firstname;
private String lastname;
private PhoneNumber phone;
private PhoneNumber fax;
// ... constructors and methods
private void calculate()
{
}
}
The Java object has been serialized on the server side and transmitted to the client.
XStream xstream = new XStream(new DomDriver());
Person joe = new Person("Joe", "Walnes");
joe.setPhone(new PhoneNumber(123, "1234-456"));
joe.setFax(new PhoneNumber(123, "9999-999"));
String xml = xstream.toXML(joe);
How do I deserialize this XML string into a Java object using JavaScript and run the methods of the person class on the client side using JavaScript?
I need assistance with syntax or guidelines for this task.