cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Maisonneuve <n.maisonne...@gmail.com>
Subject send/receive java object with ajax
Date Sun, 28 Aug 2005 13:18:34 GMT
Hi, 

I would like : 

1- in the flowscript retrieve a simple POJO object and serialize it  in xml dom:
obj  {
 id=1
 name=1;
 ob2= {
   coco="cocd";
 };
 obj3={
     coco2="azez"; 
  };
}

<obj id=" " name="">
     <obj2 coco=" foo=""/>
     <obj3 coc2=" foo=""/>
</obj>
2- send the answer to the browser client (AJAX)
3- create the javascript object according to the xml.

i think 2,3 are ok , but i don't how  do the 1

After the next step is to do:
1 - i have a javascript object
2 -serialize the object in parameter of a url
3- send the request
4- in the flowscript, recreate the object 

so i have 

--- javascript client side ---
//receive function
var obj=XMLToObject(domel);
//send function
var urlencodedobj=ObjectToUrl(obj);

--flowscript server side--
//receive function
var obj=UrlToObject (request)
//send function
var domel=ObjectToXML (obj)

so with these functions , i could communicate and send/retrieve data
without any troubles.
Maybe the idea is not new... so there is maybe some better solutions
to do this..could you point me if it is the case.

nicolas maisonneuve

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message