Dave Tolls wrote:
I think the actual root problem is how you are turning data in your database into a JSON String.
I think I asked this before, but can't see an answer in the thread, but how are you creating the JSON from the data in your database?
Ron McLeod wrote:It looks like the server-side is having problems dealing with the user name provided by the client.
In your case, it appears like the server had an issue with the user name provided by the client, and aborted the log-in procedure.
Check the log for the server-side to see if it provides any clues.
Dave Tolls wrote:So, if you don't do that conversion you see the string OK in jQGrid?
But it's when you display it in a JLabel (or something) that it goes wrong?
Again, this is without the conversion code you showed...what goes wrong when you do not do that?
What do you see that you should not see?
Dave Tolls wrote:OK, now I'm confused.
Why exactly are you trying to turn the escaped quotes in this String into two lots of double quotes?
That will not fix the broken Json.
Indeed, it is the cause of the broken Json.
Dave Tolls wrote:Can I suggest logging the fieldValue before you make any edits to it, and then after.
Not what appears in the tag.
Just what values htis bit of code is dealing with, so straight from your logs.
Dave Tolls wrote:This:
"NAME: DIVAN 2 PAX TYPE: ""A"""
contains a couple of escaped double quotes.
So the actual String is:
NAME: DIVAN 2 PAX TYPE: "A"
Looks like the translation process is failing to handle those escapes.
Dave Tolls wrote:So what is creating the JSON?
What is populating that fieldValue field?
Dave Tolls wrote:What service is this coming from?
As Ron says, it's the provider that needs fixing if (and it is an if) this is how it is being sent out.
How are you getting the String?
Ron McLeod wrote:
Steve Dyke wrote:Can this be corrected with a replaceAll method?
Maybe - but it should be fixed whatever is providing the information, not on the consumer-side. Shouldn't the information actually be something like: NAME: DIVAN 2 PAX TYPE: ASF ?