commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre-David Bélanger <rip_m...@hotmail.com>
Subject BeanUtils : Invalid mapped property
Date Sun, 17 Oct 2004 17:33:27 GMT
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


Mime
View raw message