activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Naby <user...@abwesend.de>
Subject Ajax post simulation with Java
Date Thu, 04 May 2006 09:12:12 GMT

Hi.

For our Ajax listeners we need a publisher written in Java. Our first
implemetation is posting a message to the Listener servlet but the message
doesn't reach the Ajax listener. The result code is 200.
A posting from a browser is working well.

Does anyone know the problem?

HttpClient httpclient = new HttpClient();
httpclient.setConnectionTimeout(10000);
                            
PostMethod httppost = new PostMethod(urlStr);
httppost.setRequestHeader("X-Requested-With", "XMLHttpRequest");
httppost.setRequestHeader("X-Prototype-Version", "1.4.0");
httppost.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
httppost.addParameter("destination", "topic://" + channelID);
httppost.addParameter("message", URLEncoder.encode("<message
type='chat'>Hallo</message>"));
httppost.addParameter("type", "send");
                            
httpclient.startSession(urlStr, 80);
result = httpclient.executeMethod(httppost);
httppost.releaseConnection();
--
View this message in context: http://www.nabble.com/Ajax-post-simulation-with-Java-t1555597.html#a4225552
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message