commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierre-David Bélanger <>
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("", "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" 
<bean:write name="bean" property="stringMapped("/>

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 

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 '' to be the key of the 'stringMapped' Mapped Property.

Am I wrong ?

Thanx and sorry for my english.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message