Hello Guys,
I have a JSP where all my util methods are written(can't use Java class), I included the JSP in my html(sightly file) and failed trying to invoke the methods. I can only use JavaScript use API. Any suggestions?
Thanks,
AG
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Those documents explain how to use JS API instead Java or JSP.
But you can't call JSP methods from HTL or JS API but you can convert JSP code into Java or JS and use inside HTL.
Views
Replies
Total Likes
No, in HTL you can only access model classes (SlingModels or WcmUse classes), but you cannot invoke methods from JSPs. And btw this really pollutes your application design and makes testing unnecessary hard.
Jörg
Views
Replies
Total Likes
You can't use JSP method in HTL file.
But you can use JavaScript use API, any specific issue with it?
Views
Replies
Total Likes
Hi edubey,
Please share the syntax or example how I can call using JavaScript use API. I tried but not getting the output.
Thanks.
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi Arun,
I gone through all those documentations, nothing helped. None of them has an example of invoking jsp methods in HTL or JavaScript use API.
Views
Replies
Total Likes
Here is an artilce that talks about how to use the JS API for HTL -- Creating a Tab layout component for Adobe Experience Manager
NOTE - you cannot use JSP with HTL as ppl on this thread mentioned. You can use JS with HTL - not JSP. The best way is to implement your methods in Java or use Sling Models.
Views
Replies
Total Likes
Hi,
Those documents explain how to use JS API instead Java or JSP.
But you can't call JSP methods from HTL or JS API but you can convert JSP code into Java or JS and use inside HTL.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies