Hi All,
I need to use aem debug feature for testing purpose
I need to see how the java code is invoked in response to the changes in UI side, say a mouseclick.
I need to know how a particular htl class gets a value.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi
Please check this article which shows step-by-step how to achieve that:
https://experienceleague.adobe.com/docs/experience-manager-learn/cloud-service/debugging/debugging-a...
https://aemgeeks.com/aem-debugging/how-to-start-aem-in-debug-mode/
The only thing you need to know is where in your codebase (java classes) to "set a breakpoint", you can know that easily just by checking what "sling model" is invoked from your HTL class, for example:
<!--/* HTL *-->
<div data-sly-use.model="com.myproject.models.HelloWorldModel">
<h1 class="cmp-helloworld__title">${model.title}</h1>
</div>
In the above line, the java class is HellowWorldModel.java which is under the package "com.myproject.models"
And the value ${model.title} will come from the method "getTitle()" from the model. So you would need to add a breakpoint in the "getTitle()" method from your model once the debugger is started.
Hope this helps
Learn more about sling models and HTL here: https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-wknd-tutorial-devel...
Hi
Please check this article which shows step-by-step how to achieve that:
https://experienceleague.adobe.com/docs/experience-manager-learn/cloud-service/debugging/debugging-a...
https://aemgeeks.com/aem-debugging/how-to-start-aem-in-debug-mode/
The only thing you need to know is where in your codebase (java classes) to "set a breakpoint", you can know that easily just by checking what "sling model" is invoked from your HTL class, for example:
<!--/* HTL *-->
<div data-sly-use.model="com.myproject.models.HelloWorldModel">
<h1 class="cmp-helloworld__title">${model.title}</h1>
</div>
In the above line, the java class is HellowWorldModel.java which is under the package "com.myproject.models"
And the value ${model.title} will come from the method "getTitle()" from the model. So you would need to add a breakpoint in the "getTitle()" method from your model once the debugger is started.
Hope this helps
Learn more about sling models and HTL here: https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-wknd-tutorial-devel...
Please refer to this video https://www.youtube.com/watch?v=4jLOhWuPUuc&ab_channel=JavaShastra
I hope it helps !
Views
Likes
Replies