You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Pierre-David Bélanger <ri...@hotmail.com> on 2004/10/17 19:33:27 UTC

BeanUtils : Invalid mapped property

Hi, I was facing a problem in Struts that is related to BeanUtils.

I use Mapped Properties to populate/get/set properties of a Bean.

Here is as an example, a way to reproduce the problem.

The Bean :

package org.apache.struts.webapp.exercise;
import java.util.HashMap;
import org.apache.struts.action.ActionForm;
public class StringBean3 extends ActionForm {
    private HashMap map = new HashMap();
    public StringBean() {
        map.put("key.with.dot", "a value");
    }
    public Object getStringMapped(String key) {
        return map.get(key);
    }
    public void setStringMapped(String key, Object value) {
        map.put(key, value);
    }
}

The JSP :

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<jsp:useBean id="bean" 
class="org.apache.struts.webapp.exercise.StringBean3"/>
<bean:write name="bean" property="stringMapped(key.with.dot)"/>


So I expected that the string "a value" should be printed out.

But instead I've got an exception that tells me : Invalid mapped property 
'stringMapped(key'.

I am sure that this is a bug since I do not want 'stringMapped(key' to be 
the first part of a nested property
but 'key.with.dot' to be the key of the 'stringMapped' Mapped Property.

Am I wrong ?

Thanx and sorry for my english.

Pierre.



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