AEM 6 | How to access java.util.Map object in Sightly | Community
Skip to main content
Radha_Krishna_N
Level 3
October 16, 2015
Solved

AEM 6 | How to access java.util.Map object in Sightly

  • October 16, 2015
  • 3 replies
  • 1173 views

If I am setting a map variable in the activate method of the component, then how to access that in sightly?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

Feike_Visser1
Adobe Employee
Adobe Employee
October 16, 2015

can you share your code of the Use-class?

Radha_Krishna_N
Level 3
October 16, 2015

Thanks MacDonald, It Worked.

 

I also tried with a map having custom value object as value. below is the example.

public class customVO{

    private String customVOAttr;

}

public class customPage extends WCMUse{

        private Map<String,customVO> customVOMap;

        public Map<String, customVO> getCustomVOMap() {

                return customVOMap;
        }

}

<div data-sly-list="${customPage.customVOMap.entrySet}">
        ${item.key} - ${item.value.customVOAttr} 
</div>