I don't think you understood my last post... Dojo is JavaScript, struts actions are Java. A JavaScript object is not the same thing as a Java object... Here is how a Java object looks -
00101001010100100101000100101010100100010010011 Here is how a JavaScript object looks - {'sName':"My Name",'sPhone':'212-555-1234'} What you need is serialization and deserialization. Going from Java to JavaScript, the most common method is to use JSON. Struts has a JSON result type (available as a plugin). What you need to do is install the plugin into your app. Then, you need to specify that you specify a result of type JSON for Dojo to request. There is ample documentation for processing JSON via Dojo. -Wes On Thu, Jun 11, 2009 at 10:46 AM, Rafael Taboada<kaliman.fore...@gmail.com> wrote: > Excuse my english please. > > I'm using Dojo to manage AJAX calls > > In my jsp, I call an Struts Action with dojo.xhrPost, but my action returns > another jsp, but I need to receive a Client bean with some data as a result > type > > public class Client() { > private String sName; > private String sPhone; > } > > xhrPost receives results in a load function. And here, I need to get the > Client result in order to fill some controls. > > load: function(ClientResult) { > dijit.byId('name').innerHTML = ClientResult.sName; > dijit.byId('phone').innerHTML = ClientResult.sPhone; > > } > > How can I do that? Is it possible Struts2 can send objects as a result > type?. > > -- > Rafael Taboada > Software Engineer > > Cell : +511-992741026 > > "No creo en el destino pues no me gusta tener la idea de controlar mi vida" > -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org