You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ray Madigan <ra...@madigans.org> on 2004/03/05 00:35:51 UTC
Mapped Backed ActionForm
I am having a difficult time getting Map backed ActionForm's working.
In the ActionForm class I have the following methods defined
private Map elementMap = new HashMap ( );
public Object getElementMap ( String key ) {
return ( String ) elementMap.get ( key );
}
public void setElementMap ( String key, Object value ) {
elementMap.put ( key, value );
}
In the jsp page I have
<tr><td><c:out value='${element.element}'/></td>
<td><html-el:text property='elementMap(${element.element})'
value='${element.value}'/></td>
<td>[<c:out value='${element.format}'/>]</td>
</tr>
The form initializes correctly, the initial value is set correctly, etc.
When I submit the form I get the following error, which I usually get when a
parameter is attempting to set a value in the form.
java.lang.IllegalAccessError: try to access class
org.apache.commons.beanutils.MappedPropertyDescriptor$1 from class
org.apache.commons.beanutils.MappedPropertyDescriptor
In the reset method of the form I look at the parameters of the request and
see
elementMap(perPage) with a value that is what I entered on the form.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org