Skip to main content
Source Link
Dominic Cronin
  • 18.5k
  • 3
  • 23
  • 74

The ComponentPresentationAssembler needs access to your page context to work, so the constructor overload that accepts just the publication id won't work. You need to instantiate a JSPPage with the pageContext and pass that in.

com.tridion.web.jsp.JSPPage dcdPage 
                         = new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-507637-64");
ComponentPresentationAssembler componentPresentationAssembler 
                             = new ComponentPresentationAssembler(dcdPage);

(I'd changed the constructor in my test case while solving a different problem.)

Post Made Community Wiki by Dominic Cronin