In this use case, the HTL component contains a class that extends WCMUsePojo. This class uses Java application logic to send an HTTP Request to a third-party Restful web service. The web service returns the following data in JSON format.
{
"destination_addresses":[
"Dallas, TX, USA"
],
"origin_addresses":[
"Ottawa, ON, Canada"
],
"rows":[
{
"elements":[
{
"distance":{
"text":"2,714 km",
"value":2713758
},
"duration":{
"text":"1 day 1 hour",
"value":89044
},
"status":"OK"
}
]
}
],
"status":"OK"
}
The HTL component uses the Java library GSON to parse the JSON data and then displays the data in the client so it appears on the AEM web page.
To read this development article for AEM 6.2, click https://helpx.adobe.com/experience-manager/using/restful_htl.html.
To read this development article for AEM 6.3, click https://helpx.adobe.com/experience-manager/using/restful_aem63.html.
No comments:
Post a Comment
If you have any doubts or questions, please let us know.