HstComponent Java Class Examples
Below is the code for a very simple HstComponent that sets the HippoBean that belongs to the resolved sitemap item on the HstRequest ( HttpServletRequest). We also set the site content base bean, which is the 'root' bean for the current (sub)site on the request as an example.
Simple HstComponent extending BaseHstComponent:
Example about accessing namespaced and public request parameters:
Accessing namespaced and public request paramaters:
Example about getting hst component configuration parameters without ParametersInfo annotation (note that using ParametersInfo is preferred, see HstComponent ParametersInfo annotation)
The example below is an example of an HstComponent which is a Search implementation. Note that it does not use ParametersInfo annotation, which is the preferred way, see Define a Component's Configuration Parameters. On the HstRequest, the search result, the crPage, the query and a list of available page numbers is set. The renderer (jsp / freemarker) can iterate through the result which returns HippoBean's for every hit.