[Building Sakai] Injection in JSF Managed Bean
50600822 at stu.hcmut.edu.vn
50600822 at stu.hcmut.edu.vn
Tue Mar 1 00:59:37 PST 2011
Hi, when I used SakaiAppBuilder to create a JSF HelloWorld, I looked at the faces-config and saw:
<managed-bean>
<description>Jsfdemo Tool: HelloWorld Bean</description>
<managed-bean-name>HelloWorldBean</managed-bean-name>
<managed-bean-class>org.sakaiproject.jsfdemo.tool.jsf.HelloWorldBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<description>User Directory Service</description>
<property-name>userDirectoryService</property-name>
<value>#{org_sakaiproject_user_api_UserDirectoryService}</value>
</managed-property>
</managed-bean>
First, I thought org_sakaiproject_user_api_UserDirectoryService was a bean id created by Spring then injected here. But when I looked at the applicationContext.xml , it's empty, no such bean was declared there. I deployed the tool and to my suprise, it worked fine. Can somebody tell me what happened? What kind of context that org_sakaiproject_user_api_UserDirectoryService belongs to ? is it shared across all web app? How did that context was created (I tried but still don't understand how Sakai shared components work <x_x> )? How do I get a list of beans in that context just in case I want to inject some useful bean like SessionFactory for Hibernate.
Sorry for asking too much :P
Thanks in advance.
More information about the sakai-dev
mailing list