データ・モデル
package com.foo.bar.baz.model
class Customer {
Integer id
String firstName
String lastName
.....
}
GSP
....
<f:with bean="Customer">
<f:field property="firstName"/>
</f:with>
....
GSP は、views\customer ディレクトリではなく、views\customerRegistration にあります。ページを表示しようとすると、次のようになります。
URI /myApp/customerRegistration/index Class org.springframework.beans.NotReadablePropertyException Message Bean クラス [java.lang.String] の無効なプロパティ 'firstName': Bean プロパティ 'firstName' が読み取れないか、無効な getter メソッドがあります: 戻りますかgetter の型は setter のパラメータ型と一致しますか?
データ オブジェクトの firstName フィールドを読み取れないのはなぜですか?
上記のエラーメッセージの「bean class」のみを java.lang.String から java に変更するタグ (「bean="com.foo.bar.baz.model.Customer」) に完全なパッケージを追加しようとしました。 .lang.クラス