サブクラス オブジェクトを jsp ビューからコントローラに返す方法。ページは、サブクラス要素を含む適切な動物リストを受け取ります。子クラス要素を表示することはできますが、それをコントローラーに送り返そうとすると、バインディング エラーが発生します。これは私の問題のモックコードです。
public class Group
{
public List<Animal> animals;
//getters and setters
}
abstract class Animal
{
String name;
//getters and setters
}
class Lion extends animal
{
String legs;
//getters and setters
}
私の見解:
<form:hidden path="groups[${groupssList.index}].animals[${animalsList.index}].name"/>
例外:
Could not instantiate property type [Animal] to auto-grow nested property path: java.lang.InstantiationException