struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ray Madigan" <...@madigans.org>
Subject Map Backed Form
Date Thu, 18 Sep 2003 20:02:42 GMT
I am having some difficulty with my Map Backed Form implementation.

I have in my Form:

private Properties elementMap = null;

public String getElementMap ( String key ) {
    return ( String ) elementMap.getProperty ( key );
}

public void setElementMap ( String key, String value ) {
    elementMap.put ( key, value );
}

public void reset ( ActionMapping mapping, HttpServletRequest request ) {
    ...
    elementMap = new Properties ( );
}

I have in my JSP:

<html-el:text property='elementMap(${element.element})'
value='${element.value}'/>

If I enumerate the request parameters in the reset method of the form
the paramaters and values look like:

name->elementMap(PerPage)
value->4

I get the exception
java.lang.IllegalAccessError: try to access class
org.apache.commons.beanutils.MappedPropertyDescriptor$1 from class
org.apache.commons.beanutils.MappedPropertyDescriptor

>From past experience I get this exception when struts is looking for a
setter
in my form and can't find it.  I think that struts is looking for a method
'setElementMap(perPage)' and has not figured out it is a mapped property
for some reason.  And I can't write a method with name.

Any help would be appreciated.

Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message