|
RE: How to declare an array signature in this case?: msg#00102java.dwr.user
Hi
Joe,
I've had some
similar quirks with collection properties lately, so I've done some tests
on what you suggest here:
In short, with Java5 and latest DWR from CVS it
looks like beans with collection properties are ok without adding
signatures, but objects with collection properties are broken even when
using signatures. It would be nice to fix this before 2.0.
Test setup
I'm sending a _javascript_ structure like
this to the server:
var objwithlist =
{
list: [
{firstName:"Donald", lastName:"Duck", age:72},
{firstName:"Mickey", lastName:"Mouse", age:79}
]
}
public class TestDataTypes
{
public void writeObjectWithList( ObjectWithList data ) { ... } public void writeBeanWithList( BeanWithList data ) { ... } } public class ObjectWithList
{
public List<PersonObject> list; } public class BeanWithList
{
private List<PersonObject> list; public List<PersonObject> getList() { ... } public void setList( List<PersonObject> list ) { ... } } public class PersonObject
{
public String firstName; public String lastName; public int age; } <create creator="new"
_javascript_="testDataTypes">
<param name="class" value="TestDataTypes" /> </create> <convert match="ObjectWithList" converter="object"/> <convert match="BeanWithList" converter="bean"/> <convert match="PersonObject" converter="object"/> Results
writeObjectWithList:
writeBeanWithList:
Signatures
I tried adding a signature:
<signatures>
<![CDATA[
import ...
void ObjectWithList.setList(List<PersonObject>
list);
]]>
</signatures>
in case the method signature would be used for the ObjectWithList.list
property assignment even though there is no such method, but it doesn't react on
this.
I can post my test project if you're
interested.
Best regards
Mike
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Bog post about Spwinrg MVC + AOP + DWR2, Jose Noheda |
|---|---|
| Next by Date: | I can't pass parameters to DWR POST request, Francisco González Guillén |
| Previous by Thread: | Bog post about Spwinrg MVC + AOP + DWR2, Jose Noheda |
| Next by Thread: | RE: How to declare an array signature in this case?, Mike Wilson |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |