You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Oguz Kologlu <oz...@optusnet.com.au> on 2007/08/02 04:32:24 UTC

[S2] dojo 0.9 and ***-conversion.properties

Hi all,

It seems when doing a dojo.xhrPost any collection object eg: contacts 
[0].firstName gets encoded to  contacts %5B0%5D.firstName.

The ***-conversion.properties don't seem to recognise the element as  
person so the person collection remains null and with lots of  
intercepter errors:

Unexpected Exception caught setting 'contacts%5B0%5D.firstName' on  
'class easybed.web.struts2.ContactsAction: Error setting expression  
'contacts%5B0%5D.firstName' with value '[Ljava.lang.String;@284bf3'

Dojo 0.4.3 used to work ok (probably it didn't encode `[`  
characters). I realise this is a borderline S2 issue since it ships  
with 0.4.3 but it will eventually have to support 0.9 and will have  
to solve the issue.

Has anyone come across this and have a workaround/solution for the  
time being?

Thanks,
Oz

Re: [S2] dojo 0.9 and ***-conversion.properties

Posted by "David Durham, Jr." <da...@gmail.com>.
On 8/1/07, Oguz Kologlu <oz...@optusnet.com.au> wrote:
> Unexpected Exception caught setting 'contacts%5B0%5D.firstName' on
> 'class easybed.web.struts2.ContactsAction: Error setting expression
> 'contacts%5B0%5D.firstName' with value '[Ljava.lang.String;@284bf3'
>
> Dojo 0.4.3 used to work ok (probably it didn't encode `[`
> characters). I realise this is a borderline S2 issue since it ships
> with 0.4.3 but it will eventually have to support 0.9 and will have
> to solve the issue.

Only thing I can think of is that maybe the parameter name is being
double escaped with JavaScript.  You might be able to test this by
manually forming a URL like:

   http://.../MyAction.do?contacts%5B0%5D.firstName=value

and seeing if the value is set properly in your action.  I think it
should be.  But, if you make the following request:

      http://.../MyAction.do?contacts%255B0%255D.firstName=value

which has the parameter name contacts[0].firstName in a double-escaped
form, maybe you can reproduce your error.  If the first URL is fine,
but the second URL fails with the exception you're seeing, then you're
double-escaping in your browser.  Could be a dojo bug, or just
something that's changed from 0.4.3 to 0.9 that users need to be aware
of.  Not sure.

HTH,

Dave

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