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 FW: BeanUtils : Invalid mapped property
Date Sun, 17 Oct 2004 18:04:00 GMT

Oups !

Very sorry about that, but the bug actually only happens when I set the 
property and NOT when I get it.

So the last example will not throw any exception but this example will do :

The same 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/tld/struts-nested-1.1.tld" prefix="nested" %>
<nested:form action="/an/action/that/use/StringBean3/as/the/formBean" >
	<nested:text property="stringMapped(key.with.dot)"/>
	<nested:submit/>
</nested:form>

The form will show up the right value, but on the form 'submit' I get the 
'Invalid mapped property

'stringMapped(key'' exception.

Sorry again!

Thanx.

Pierre

----Original Message Follows----
From: Pierre-David Bélanger <rip_mind@hotmail.com>
Reply-To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
To: commons-user@jakarta.apache.org
Subject: BeanUtils : Invalid mapped property
Date: Sun, 17 Oct 2004 17:33:27 +0000
MIME-Version: 1.0
X-Originating-IP: [65.93.181.147]
X-Originating-Email: [rip_mind@hotmail.com]
X-Sender: rip_mind@hotmail.com
Received: from mail.apache.org ([209.237.227.199]) by mc7-f27.hotmail.com 
with Microsoft SMTPSVC(5.0.2195.6824); Sun,

17 Oct 2004 10:34:12 -0700
Received: (qmail 6578 invoked by uid 500); 17 Oct 2004 17:34:07 -0000
Received: (qmail 6464 invoked by uid 99); 17 Oct 2004 17:34:06 -0000
Received: pass (hermes.apache.org: local policy)
Received: from [65.54.245.32] (HELO hotmail.com) (65.54.245.32)  by 
apache.org (qpsmtpd/0.28) with ESMTP; Sun, 17 Oct

2004 10:34:05 -0700
Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; 
Sun, 17 Oct 2004 10:34:02 -0700
Received: from 65.93.181.147 by by1fd.bay1.hotmail.msn.com with HTTP;Sun, 17 
Oct 2004 17:33:27 GMT
X-Message-Info: JGTYoYF78jGuTvAZlRl3BPTXhd129Tpk
Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:commons-user-unsubscribe@jakarta.apache.org>
List-Subscribe: <mailto:commons-user-subscribe@jakarta.apache.org>
List-Help: <mailto:commons-user-help@jakarta.apache.org>
List-Post: <mailto:commons-user@jakarta.apache.org>
List-Id: "Jakarta Commons Users List" <commons-user.jakarta.apache.org>
Delivered-To: mailing list commons-user@jakarta.apache.org
X-ASF-Spam-Status: No, hits=1.5 required=10.0tests=DNS_FROM_RFC_POST
X-Spam-Check-By: apache.org
Message-ID: <BAY1-F32IWDO3hRDT6Z00023f4c@hotmail.com>
X-OriginalArrivalTime: 17 Oct 2004 17:34:02.0846 (UTC) 
FILETIME=[7E69F7E0:01C4B46F]
X-Virus-Checked: Checked
Return-Path: 
commons-user-return-9364-rip_mind=hotmail.com@jakarta.apache.org

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



---------------------------------------------------------------------
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