That's not possible as most browsers enforce "same origin policy" ( http://en.wikipedia.org/wiki/Same_origin_policy) so you can't connect to remote hosts from your ajax scripts (the same is with web sockets as well). The cleanest workaround for that would be to have some kind of ajax servlet on that other host as well that will get the messages so js page can poll them.
Regards -- Dejan Bosanac Senior Software Engineer | FuseSource Corp. dej...@fusesource.com | fusesource.com skype: dejan.bosanac | twitter: @dejanb blog: http://www.nighttale.net ActiveMQ in Action: http://www.manning.com/snyder/ On Tue, Mar 20, 2012 at 8:14 PM, unficyp <gerald.we...@besharp.at> wrote: > Hi, > > so i changed a few things. > - my java code sends to the standalone broker. i can see the messages in > the > /admin page and in my java test code. > - i copied my js test html to the /demo dir so that i can access it using > the jetty in standalone broker. > - i see the messages arricing in the ajax code. > > Seems to work using this approach. > > What i want to achieve is: > - my java daemon should have an embedded broker and all messages should be > written from zmq to activemq > (this already works) > - my java daemon should enable an embedded jetty to provide the messages > using ajaxservlet > - another html/js page running on another webserver should connect to the > ajaxservlet to receive the messages. > > my mistake was to use amq.js from another webserver (http://test.local > running xampp) connecting to the embedded jetty (uri: http://127.0.0.1/amq > in the init call ) > > Is that possible ? > Serving the html (Monitoring application) from jetty is NOT an option. > > thanks & regards, > gerald > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/Embedded-Broker-AJAXServlet-Jetty-tp4487915p4490038.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >