View File | Revision Log | Show Annotations | Download File | View Changeset
/hippo/hippo-documentation/hst_docs/trunk/content/prepared/client-side_component_assembly.txt
Revision: 21417
Committed: Tue Jan 26 17:00:05 2010 UTC (10 years, 5 months ago) by rbijlsma
Content type: text/plain
File size: 1866 byte(s)
Log Message:
HSTTWODOCS-242

File Contents

# Content
1 how to utilize a hst client component manager
2 ----------------------------------------------------------
3
4 Key: HSTTWODOCS-246
5 URL: http://issues.onehippo.com/browse/HSTTWODOCS-246
6 Project: Hippo Site Toolkit 2.Docs
7 Issue Type: Task
8 Reporter: Ard Schrijvers
9 Assignee: Rita Bijlsma
10
11
12 If a site developer wants to use client-side components assembly in the site application, he or she should uncomment the two init parameters of the HstContainerServlet in the web.xml as follows:
13
14 <init-param>
15 <param-name>clientComponentManagerClass</param-name>
16 <param-value>org.hippoecm.hst.component.support.ClientComponentManager</param-value>
17 </init-param>
18 <init-param>
19 <param-name>clientComponentManagerConfigurations</param-name>
20 <param-value>/META-INF/client-assembly/*.xml</param-value>
21 </init-param>
22
23 If the above init parameters are set, then the HstContainerServlet will initialize a spring-based component manager by reading the configuration resources (/META-INF/client-assembly/*.xml) from the classpath such as /WEB-INF/classes.
24
25 And, the HstContainerServlet will add an attribute of the component manager into the servlet context. The attribute name is "org.hippoecm.hst.container.HstContainerServlet.clientComponentManager" by default. This name can be configured by another init-parameter, "clientComponentManagerContextAttributeName".
26
27 Therefore, an HST component or any servlet or JSP pages can use codes like the following to access the component manager:
28
29 import org.hippoecm.hst.core.container.ComponentManager;
30
31 ComponentManager compManager = (ComponentManager) servletContext.getAttribute("org.hippoecm.hst.container.HstContainerServlet.clientComponentManager");
32 String greeting = compManager.getComponent("greeting");
33

Properties

Name Value
svn:eol-style native
svn:keywords Id