April 26, 2020
Estimated Post Reading Time ~

HashMap in Sightly/HTL

Use hashmap in sightly / HTL

WCMUsePojo code


package com.kishore.sightly;

public class GetMap extends WCMUsePojo {
Map<String, String> myMap = null;
@Override
public void activate() throws Exception {
myMap = new HashMap<String, String>();
myMap.put("name", "Kishore");
}

public Map<String, String> getmyMap() {
return myMap;
}


HTL code<sly data-sly-use.model="com.kishore.sightly.GetMap" /> Name: ${model.myMap['name']}



By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.