アクションクラス
public class ProductAction extends ActionSupport implements Preparable {
private Document product;
}
モデル
public class Document {
private Map<String, Object> properties;
}
JSP
<s:textfield name="product.properties.PRODUCT_NAME"
value="% {product.properties..PRODUCT_NAME}"
label="%{getText('label.PRODUCT_NAME')}" size="40" />
<s:textfield name="product.properties.SUPPLIER"
value="%{product.properties.SUPPLIER}"
label="%{getText('label.SUPPLIER')}" size="40" />
Product_name と Supplier は、Map ( Map<String, String[]>
) プロパティの配列として取り込まれます。
PRODUCT_NAME : [Ljava.lang.String;@4e96ac47]
SUPPLIER : [Ljava.lang.String;@1c90a278]
Document->properties を変更すると、正常にMap<String, String>
動作します。
Map<String, Object>
しかし、他のデータ型のためにDocument->properties を保持したいと思います。
この問題を解決するには、フォーム データをString
ではなくとして入力する必要がありString[]
ます。
同じ名前のテキスト フィールドが複数ありません。