The constructor accepts a
of Strings representing JCR properties to exclude from the JSON output. You may want to ignore the standard
properties while allowing only your custom properties to populate the JSON.
The overloaded dump methods allow you to pass in the recursion level similar to how you would use a selector when making AJAX calls to the
Default Get Servlet
. Just as you can cURL
, you can pass in a positive integer for the recursion level as well as
for infinite recursion.
Likewise, just as you can cURL
/content/geometrixx/en.tidy.json, you can specify whether you want the JSON output nicely formatted or not.
The following examples demonstrate the JsonItemWriter utilizing a PrintWriter in a servlet and a JSONObject in a standard Java class.