I have a problem: 3 つの子クラス Student、Teacher、Parent があります。
public class Person implements Serializable{
private String name;
private String address;}
学生:
public class Student extends Person {
private String cardNo;
}
スプリングレスト :
@RequestMapping(method = RequestMethod.POST, value = "/create")
@ResponseBody
public CemeteryRestResponse<Boolean> create(
@RequestBody Person person) throws Exception {.....}
この 3 つの役割を作成するには、one rest メソッドを使用したいと考えています。しかし、クライアント ポスト Student as JSON では、例外がスローされます。
org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "cardNo"
前もって感謝します!