activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Ajax post simulation with Java
Date Thu, 04 May 2006 09:18:13 GMT
What is urlStr and what is your web.xml? BTW have you tried out the
activemq-web-demo web application? You can use your browse to post/get
messages to test out the servlets.

On 5/4/06, Naby <user_is@abwesend.de> wrote:
>
>
> 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.
>
>


--

James
-------
http://radio.weblogs.com/0112098/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message