For example, consider the OSGi bundle that uses web services to return weather information. (For information about this OSGi bundle, see http://scottsdigitalcommunity.blogspot.ca/2012/05/creating-adobe-cq-bundles-that-consume.html.)
Note: The OSGi bundle that returns weather data uses web services to expose various operations that return weather data. To follow along with this development article, you must create the weather OSGi bundle by following that article.
You can use a JSONWriter instance to return weather data based on user input. For example, consider the following graphical user interface that lets a user select a US ZIP code from a drop-down menu:
When the user selects a US Zip code from the drop-down menu and clicks the Click Me button, the weather service OSGi bundle is invoked. A JSONWriter instance is used to invoke the OSGi bundle and the data is returned to the JSP, as shown in the following illustration.
To read this full article, click this link:
http://helpx.adobe.com/experience-manager/using/using-jsonwriter-objects-display-cq.html
http://helpx.adobe.com/experience-manager/using/using-jsonwriter-objects-display-cq.html
Join the Adobe Experience Cloud Community
Join the Adobe Experience Cloud Community by clicking this banner
I (Scott Macdonald) am a Senior Digital Marketing Community Manager at Adobe Systems with 20 years in the high tech industry. I am also a programmer with knowledge in Java, JavaScript, C#,C++, HTML, XML and ActionScript. If you would like to see more CQ or other Adobe Digital Marketing end to end articles like this, then leave a comment and let me know what content you would like to see.
Twitter: Follow the Digital Marketing Customer Care team on Twitter @AdobeExpCare.
YouTube: Subscribe to the AEM Community Channel.
Twitter: Follow the Digital Marketing Customer Care team on Twitter @AdobeExpCare.