How to register a component properly?

hello!

I’m trying to create a simple component with a static text.

what I did:

  1. created hst:containeritemcomponent in catalog

  2. created hst:template in templates

  3. created the template in Freemaker

  4. created java class org.example.beans.Buttons

But when I add it on a page it’s empty

And I see these errors in the console

What I did wrong? Probably there is some issue with the namespace, but I’m not sure.

What steps missed?

Thanks!

PS looks like it’s hard to view the images here… to view the images open the in a new tab or zoom in the page, sorry.

“org.example.beans.Buttons cannot be cast to HStComponent” is the clue…

Your mixing up document beans and components. A bean extends HippoDocument and represents a document instance (data), below /content/documents. You need a component (controller) extending BaseHstComponent. See at HstComponent Java Class - Bloomreach Experience Manager - The Fast and Flexible Headless CMS and sibling pages.

Also you can use Essentials (Bloomreach Experience Manager Essentials Project Setup - Bloomreach Experience Manager - The Fast and Flexible Headless CMS) to add say Simple Content and see how it works.

Cheers, Jeroen

1 Like

thank you very much!