Last active
January 2, 2016 07:09
-
-
Save ajduke/8268377 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Example34 { | |
public static void main(String[] args) { | |
String str ="<myval>"; | |
Gson gson = new Gson(); | |
System.out.println("Normal behaviour..."); | |
System.out.println(gson.toJson(str)); | |
System.out.println("\nDisabled html escaping..."); | |
gson = new GsonBuilder().disableHtmlEscaping().create(); | |
System.out.println(gson.toJson(str)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment