Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Trusted Contributor
Posts: 227
Registered: ‎12-16-2009
My Device: 9530,8900,9000

XMPP JXA library issue while Sending message

I am working on Chat application and for that I am using JXA Library of J2ME http://sourceforge.net/projects/jxa/

in my application.

 

I have to send Json String as Message I am sending data to server as JSON but at server its appended with 2 times double quote.

 

Ex. I am sending  {"Name":"Hims"}.

But on Server I am getting {""Name"":""Hims""};

 

I don't what is issue with this.

If any one know what is issue then please let me know.

Any kind of help will be appreciated.

 

Lathiya Himanshu
Developer
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: XMPP JXA library issue while Sending message

Hi,

 

Check out this post from the project home:

http://sourceforge.net/projects/jxa/forums/forum/587939/topic/1725553

 

Hope that helps,

 

E.

Regular Contributor
Posts: 95
Registered: ‎07-16-2010
My Device: 8520

Re: XMPP JXA library issue while Sending message

hello hims

 

 

thats realy major issue

 

i have same problem so i changes in XMLWritter class as below

 

changes in writeEscaped()

 

private void writeEscaped(final String str) throws IOException 
	{
		final int index = 0;
		for (int i = 0; i < str.length(); i++) {
			final char c = str.charAt(i);
			switch (c) 
			{
			case '<':
				{
					writer.write("&lt;");
					break;
				}
			case '>':
				{
					writer.write("&gt;");
					break;
				}
			case '&':
				{
					writer.write("&amp;");
					break;
				}
			case '\'':
				{
					writer.write("&apos;");
					break;
				}
			case '"':
				{
					writer.write("&quot;");
					break;
				}
			default:
				{
					writer.write(c);
					break;
				}
			}
		}
	}

 

 

its definatly work try it