In my previous article’s you have seen how to export page data as a JSON format using servlet, now, I am going to explain exporting page content as JSON using sling models exporter, using sling model exporter you can get below advantages
- No need to write servlet to export data as JSON format
- You can use same code which is written using sling models to render content and to export as JSON format
Sling model exporter is very useful when you want to publish your data to third party system’s or consuming within the site using ajax request if you have sling models and wants to serialize them, by providing simple @Exporter annotations to the existing sling models you can convert your model to CaaS based URL
Refer below link to get to access to complete article and to download code
http://keysandstrokes.info/aem-code-snippets-export-page-data-as-json-format-using-sling-model-expor...