[JDEV] Formatting pt. 2 - JAJC
Cunningham, Steven
Steven.Cunningham at LibertyMutual.com
Fri Aug 15 07:52:08 CDT 2003
Ok, I *think* I'm getting close, but I get the
SendMessageFailedException.
SendMessageFailedException.getLocalizedMessage() returns this: The
element "message" could not be added as a child of "message": The
element already has an existing parent (the document root)
--Code--
JabberChatMessage msg = new
JabberChatMessage(JabberChatMessage.TYPE_CHAT);
msg.setTo(jabTo);
msg.setHTMLBody(message);
msg.setSynchronized(false);
jabberSession.sendMessage(msg);
Steven Cunningham
Database Management Group
Liberty Mutual
-----Original Message-----
From: Chris Chen [mailto:ckchris at idream.net]
Sent: Wednesday, August 13, 2003 4:00 PM
To: Cunningham, Steven
Subject: Re: [JDEV] Formatting pt. 2 - JAJC
Hi,
That is not how you utilize the jabber chat service's
sendPrivateMessage().. You should read the javadocs for the method.
JabberChatService.sendPrivateMessage() accepts a recipient JID and the
"body" of the message, NOT the XML representation of the message.
As I mentioned before, please read my previous post on how to send a
chat message that contains HTML. I replied to your message yesterday.
Thanks,
Chris
----- Original Message -----
From: "Cunningham, Steven" <Steven.Cunningham at LibertyMutual.com>
To: <jdev at jabber.org>
Sent: Wednesday, August 13, 2003 12:35 PM
Subject: RE: [JDEV] Formatting pt. 2 - JAJC
> Can someone tell me if I'm doing this wrong?
>
> -- Java Code --
>
> String jabMessage = "<message><body>OMG, i'm green with
> envy!</body><html xmlns='http://jabber.org/protocol/xhtml-im'><body><p
> style='font-size:large'>OMG, i'm <span
> style='color:green'>green</span> with
> <em>envy</em>!</p></body></html></message>";
>
> JabberChatService chat = jabberSession.getChatService();
>
> chat.sendPrivateMessage(to, message);
>
> -- End Java Code --
>
> Steven Cunningham
> Database Management Group
> Liberty Mutual
>
>
> -----Original Message-----
> From: David 'TheRaven' Chisnall [mailto:theraven at sucs.org]
> Sent: Wednesday, August 13, 2003 11:41 AM
> To: jdev at jabber.org
> Subject: Re: [JDEV] Formatting pt. 2 - JAJC
>
>
> JAJC does support some form of XHTML, although it claims to be <html
> xmlns="http://www.w3.org/TR/xhtml-basic">, rather than the recommended
> <html xmlns="http://jabber.org/protocol/xhtml-im"> from JEP-71, so I
> don't know how compatible it is with other implementations.
>
> Cunningham, Steven wrote:
>
> > Formatting pt. 2 - JAJC
> >
> > I got responses on formatting messages with the Exodous client, but
> > it seems that it's not possible.
> >
> > Now I'd like to ask how/if it's possible to do so with the JAJC
> > client?
> >
> > * Steven Cunningham *
> > Database Management Group
> > Liberty Mutual
> >
>
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
>
Steven Cunningham
Database Management Group
Liberty Mutual
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.jabber.org/jdev/attachments/20030815/04c7d5fd/attachment-0002.htm>
More information about the JDev
mailing list