Skip to content

Instantly share code, notes, and snippets.

@ajduke
Last active January 2, 2016 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajduke/8268377 to your computer and use it in GitHub Desktop.
Save ajduke/8268377 to your computer and use it in GitHub Desktop.
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