struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sean jones <sean.jo...@ubs.com>
Subject Updating a HashMap backed Form
Date Tue, 01 Jun 2004 13:32:56 GMT
Problem -  salaries are to be split between N entities.

CLASS SplitBean (String entity, double sal, double percent)
//getter and setters for each


CLASS  SalarySplit ()
String getTotalPercent()
String getTotalSalary()
HashMap splits 
HashMap getSplits()

setEntity(String key, String ent)
setSalary(String key, String sal)
setPercent(String key, String percent)

getEntity(String key)
getSalary(String key)
getPercent(String key)

CLASS bean()

SalarySplit salarySplit
getSalarySplit()


<logic:iterate name="bean" property="salarySplit.splits"/>
<%
	list1 = "salarySplit.costCenter["+ccr+"]";
	list2 = "salarySplit.amount["+ccr+"]";
        list3 = "salarySplit.percent["+ccr+"]";
%>

<html:text name="bean" property=[<%=list1%>]"/>
<html:text name="bean" property=[<%=list2%>]"/>
<html:text name="bean" property=[<%=list3%>]"/>
</logic:iterate>


key = Y 42A
generates the following error. 

282c72eb WebGroup      X Servlet Error: Invalid indexed property &#39;costCenter
[Y 42A]&#39;: java.lang.IllegalArgumentException: Invalid indexed 
property 'costCenter[Y 42A]'

should the value |Y 42A| be quoted?


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


Mime
View raw message