You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by apurav chauhan <ap...@yahoo.com> on 2010/02/21 20:15:18 UTC
Parsing TextMessage in JavaScript
hello all,
i am working with amq.js and ajax. i know how to get the contents of the
message if it is sent through the
javascript like:
Sender code:
amq.sendMessage("topic://APURAV",""+document.getElementById("chatboxs").value+"");
Callback method
function(message)
{
alert("received
"+message.childNodes[0].data+message.getAttribute('type'));
}
--------------------------------------------------------
But if i publish a TextMessage from my servlet through the code , i dont
know how to read the contents of that message.
Even though the above callback method works but i have no idea how to print
the contents.
Servlet Code Sample
...
TextMessage message =session.createTextMessage("hello");
message.setStringProperty("type", "apurav");
producer.send(message);
PLEASE HELP ME WITH PRINTING THIS MESSAGE IN CALLBACK HANDLER.
THANKS IN ADVANCE
--
View this message in context: http://old.nabble.com/Parsing-TextMessage-in-JavaScript-tp27676880p27676880.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.