# Getting all components on an Experience Page

**URL:** <https://community.bloomreach.com/t/getting-all-components-on-an-experience-page/4579>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [November 28, 2024, 10:52am UTC](https://community.bloomreach.com/t/getting-all-components-on-an-experience-page/4579 "2024-11-28T10:52:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![arno](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@arno](https://community.bloomreach.com/u/arno)\
**Post date:** [November 28, 2024, 10:52am UTC](https://community.bloomreach.com/t/getting-all-components-on-an-experience-page/4579/1 "2024-11-28T10:52:30Z")

</div>

Hi everybody,

How do I get access to all available components on an Experience Page?

With regular pages I was always able to fetch all components by getting the HstComponentConfiguration from the ResolvedSitemapItem as follows:

```auto
ResolvedSiteMapItem resolvedSiteMapItem = request.getRequestContext().getResolvedSiteMapItem();
    HstComponentConfiguration hstComponentConfiguration = resolvedSiteMapItem.getHstComponentConfiguration();

```

I could then get a hold of all available components on the current page.

With Experience Pages that doesn’t seem to work anymore. I simply get a null returned when calling resolvedSiteMapItem.getHstComponentConfiguration.

I get that the hst configuration has moved to the Document node that represents the Experience Page and might not qualify as hst configuration any more. However, can I get these components from somewhere else? Would I have to get them from the Exprience Page Document node? I simply can’t find this explained anywhere.

Thanks!

---

<div class="post-metadata">

**Author:** ![david.bailey](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/david.bailey/32/1490_2.png) [@david.bailey](https://community.bloomreach.com/u/david.bailey)\
**Post date:** [November 28, 2024, 11:43am UTC](https://community.bloomreach.com/t/getting-all-components-on-an-experience-page/4579/2 "2024-11-28T11:43:51Z")

</div>

It should be possible to get the components from the xpage document yes. They sit under the hst:xpage node.

---

<div class="post-metadata">

**Author:** ![jasper.floor](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jasper.floor/32/28_2.png) [@jasper.floor](https://community.bloomreach.com/u/jasper.floor)\
**Post date:** [November 28, 2024, 12:19pm UTC](https://community.bloomreach.com/t/getting-all-components-on-an-experience-page/4579/3 "2024-11-28T12:19:23Z")

</div>

Hmmm, I think your code should’ve worked, but I can’t say I’ve tried it. But looking in the code for org.hippoecm.hst.site.request.ResolvedSiteMapItemImpl, it should return something. If it’s null, possibly you have the wrong sitemap item?

---

<div class="post-metadata">

**Author:** ![arno](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@arno](https://community.bloomreach.com/u/arno)\
**Post date:** [November 28, 2024, 2:25pm UTC](https://community.bloomreach.com/t/getting-all-components-on-an-experience-page/4579/4 "2024-11-28T14:25:25Z")

</div>

The strange thing is that the ResolvedSitemapItem also does not indicate that the this is in fact an Experience Page when I call resolvedSiteMapItem.isExperiencePage()

There might indeed be something wrong with my sitemap matching. I will investigate further.

---

<div class="post-metadata">

**Author:** ![arno](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@arno](https://community.bloomreach.com/u/arno)\
**Post date:** [December 12, 2024, 1:09pm UTC](https://community.bloomreach.com/t/getting-all-components-on-an-experience-page/4579/5 "2024-12-12T13:09:35Z")

</div>

It turns out that

```auto
ResolvedSiteMapItemImpl.resolveComponentConfiguration()

```

in `org.hippoecm.hst.site.request.ResolvedSiteMapItemImpl` the does not support getting the HstComponentConfiguration when the current context is a Plain JAX-RS rest mount.

The logic in the ResolvedSiteMapItemImpl always gets the ResolvedSiteMapItem based on the current context and then tries to get the ContentBean which is then null.

```auto
RequestContextProvider.get().getContentBean()

```

Therefore it skips loading the Experience Page.

I’ve fixed this issue by implementing custom fallback logic to fetch the Experience Page Based on my own fetched ResolvedSiteMapItem:

```auto
HstComponentConfiguration componentConfiguration = myResolvedSiteMapItem.getHstComponentConfiguration();

if(componentConfiguration != null){
  //move along, everything is fine
  return componentConfiguration;
} else {
  //check if this is an Experience Page
  HstRequestContext hstRequestContext = RequestContextProvider.get();
  HippoBean siteContentBaseBean = hstRequestContext.getSiteContentBaseBean();
  HippoBean contentBean = siteContentBaseBean.getBean(myResolvedSiteMapItem.getRelativeContentPath());

  Node node = contentBean.getNode();
  try {
    if (node.isNodeType("hst:xpagemixin") && node.hasNode("hst:xpage")) {
      Node page = node.getNode("hst:xpage");
      ExperiencePageService experiencePageService = HippoServiceRegistry.getService(ExperiencePageService.class);
      HstComponentConfiguration xpageComponentConfiguration = experiencePageService.loadExperiencePage(page, myResolvedSiteMapItem.getHstSiteMapItem().getHstSiteMap().getSite(),
            HippoWebappContextRegistry.get().getContext(hstRequestContext.getMount("my-site-alias").getContextPath()).getServletContext().getClassLoader());
      //happy days
      return xpageComponentConfiguration;
    }
  } catch (RepositoryException repositoryException) {
      throw new ExperiencePageLoadingException("Failed to load HstPage", repositoryException);
    }
 }

```

Thanks for pointing me in the right direction!

---

<div class="post-metadata">

**Author:** ![RSinha](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/rsinha/32/1384_2.png) [@RSinha](https://community.bloomreach.com/u/RSinha)\
**Post date:** [December 19, 2024, 12:30pm UTC](https://community.bloomreach.com/t/getting-all-components-on-an-experience-page/4579/6 "2024-12-19T12:30:44Z")

</div>

Hi Arno,

Thank you for your valuable input.  
We are looking forward to your continuous contribution towards our vibrant Bloomreach Community.
