WCMUsePojo and getRequest()




I am attempting to implement a new feature on our site, with code provided by a vendor. They have provided a .jar and example .jsp files. I am in the process of converting the jsp to HTL/WCMUsePojo class. In their .jsp example they have:

IXFSDKParameters parameters = new IXFSDKParameters(request);

IXFSDKClient client = new IXFSDKClient(ixfConfig, response, parameters);

From what I have found online, it appears in my WCMUsePojo class I should be able to get the request and response objects from getRequest() and getResponse(). I have tried getRequest() but it returns null.

Is there anything I'm missing in the java class? Our site uses many classes that extend WCMUsePojo but we have not tried to access the request/response objects from them before.

Thank you!





Hi Arun,

Adding the data-sly-use call in my navigation component did not pass the request object. I was able to get it working by passing request/response as parameters to my WCMUsePojo class.

<div data-sly-use.dataProvider="${'com.site.aem.dataproviders.NewLinkProvider' @prop=request,propr=response}"></div>

When I tried data-sly-use in my template (basepage.html) it does not have the same issue. I am able to get the correct request/response without passing the parameters.

<html lang="en-US" data-sly-use.dataProvider="${'com.site.aem.dataproviders.NewLinkProvider'}">

Are the request/response objects not available when data-sly-use is added in a component?

This is my class below with the parameters code removed.

public class NewLinkProvider extends WCMUsePojo {

    private static final Logger logger = LoggerFactory.getLogger(NewLinkProvider.class);

    private String headOpenData;

    private String bodyOpenData;

    private String bodyStringData;


    public void activate() throws Exception {


          //IXF Configuration items have been removed

            IXFSDKParameters parameters = new IXFSDKParameters(getRequest());

            IXFSDKClient client = new IXFSDKClient(ixfConfig, getResponse(), parameters);

            this.headOpenData = client.getHeadOpen();

            this.bodyOpenData = client.getBodyOpen();

            this.bodyStringData = client.getBodyString("body_1");


    public String getHeadOpenData() {

        return headOpenData;


    public String getBodyOpenData() {

        return bodyOpenData;


    public String getBodyStringData() {

        return bodyStringData;