net.sf.json.JSONObject adds backslashes where it's not expected ?

Posted by cx42net on Stack Overflow See other posts from Stack Overflow or by cx42net
Published on 2010-05-27T15:10:27Z Indexed on 2010/05/27 15:21 UTC
Read the original article Hit count: 194

Filed under:
|
|

Hi there,

I'm loosing my hair trying to figure out why net.sf.json.JSONObject add extra backslash where it shouldn't on my java code :

JSONObject obj = new JSONObject ();
obj.element ("column_name", "<a href=\"#\" title=\"test\">Test !</a>");

will output :

<a href=\"#\" title=\"test\">Test !<\/a>

with an extra "\" near <\/a>.

How can I avoid this behavior ?

Thanks for your help !

© Stack Overflow or respective owner

Related posts about java

Related posts about JSON