Handling JSP expressions in HTL/Sling Model
Hello Community - We have a JSP based template which needs to be converted into HTL. Currently we have planned to move all the business logic in Sling Model. Can you advise the best approach to handle the below in HTL.
A) <c:set var="runMode" value="uat" scope="request"/> - We can use <div data-sly-test.runMode="uat"> to assign a variable name, which can later be used like <div>${runMode}</div>. If the assignment is for few variables, we can use this approach, but this is not a best approach. Is there any better solution to handle this ?
B) request.setAttribute("isProductActive", isProductActive); - In the current implementation, we are setting the values in request. How can we handle this? If this has to be done in Sling model. How do we use this in HTL.
C) pageContext.setAttribute("fetchData",fetchData); - This is also required to handle in HTL.