FYI, if you *do* want or need to return XML, there is one way to make it at least a little less painful: the JavaScript implementation of Commons Digester JSDigester:
http://javawebparts.sourceforge.net/javadocs/javawebparts/taglib/jstags/JSDigesterTag.html Full-blown example can be seen in the Java Web Parts example app: http://javawebparts.sourceforge.net It doesn't have all the features of it's big brother, but it's more than useful as-is... I used it extensively one project ago to consume some Web Services, worked like a charm. I do happen to agree though, I try to dissuade people from using XML when doing AJAX as well for performance reasons if nothing else, but there are certainly valid reasons to use it, and if you have to, JSDigester can make life a good deal better. Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of "Practical Ajax Projects With Java Technology" (2006, Apress, ISBN 1-59059-695-1) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Tue, February 13, 2007 1:20 pm, Musachy Barroso wrote: > If you are making the call using the anchor or submit tag in the ajax > theme, the returned text is available as a parameter(first parameter, > when "type" is load) to the "notifyTopics", see: > > http://cwiki.apache.org/WW/ajax-tags.html > > If you are going to use Dojo directly,: > > dojo.io.bind({ > url: "/youraction", > handler: function(type, data, e) { > var id = data; > //use your id > }, > mimetype: "text/html" > }); > > That's assuming you are going to return just the id in the response. You > can also returned a JSON string if you need to return more data. Or you > can (but it will hurt :) ) return xml, which I wouldn't recommend unless > you have to. If you happen to be using GWT, you can just return the int > from your method, and you will just get it back on your GWT(javascript) > code. These are just a few ideas, there's got to be zillion ways of > doing it these days. > > musachy > > Monttez wrote: >> Hi all >> >> I want to make an ajax call to a method and get its returning.. (for use >> in a javascript fragment) >> >> >> For example: I want to get the Id for the inserted person (in an ajax >> insert..).. >> >> >> How it is possible? >> >> >> This method could be in an action or directly in my Service class.. >> >> >> >> Thanks in advance >> >> Luciano >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]