<form:select>
タグを使用して編集コンテンツ.jsp内の以下のENUMを使用しようとしていますが、これを行う方法の例が見つかりません。Java ENUMの使用方法<form:select>
public class Content implements Serializable {
public enum Paperless {
NONE(null, ""),
EDELIVERY_RECOMMENDED("EDELIVERY_RECOMMENDED", "Recommend eDelivery"),
EDELIVERY_REQUIRED("EDELIVERY_REQUIRED", "Require eDelivery"),
EDELIVERY_REQUIRED_JUSTIFICATION("EDELIVERY_REQUIRED_JUSTIFICATION", "Require eDelivery w/out justification");
private String name;
private String description;
Paperless(String name, String description) {
this.name = name;
this.description = description;
}
public String getName() {
return this.name;
}
public String getDescription() {
return this.description;
}
}
....
上記コンテンツオブジェクトは${content}
として私.jspファイルに渡されます。私は
<form:select path="content.Paperless">
<form:options items="${content.Paperless}" itemLabel="name"/>
</form:select>
それは例外をスローだがやろうとしている
.... org.springframework.beans.NotReadablePropertyException: Invalid property 'content' of bean class [com.fettergroup.cmt.model.Content]: Bean property 'content' is not readable or has an invalid getter method: Does the return type of the getter match the parameter
...
私はこれについて何かを誤解していますが、私はその1を特定することはできません
何Content' 'で'一覧 getPaperlessOptions() 'メソッドはどうですか?これにより、あなたのページに 'items =" $ {content.paperlessOptions} "'と書く必要があります。 –
Thomas